Original report by Jeff Blaine (Bitbucket: jblaine, GitHub: jblaine).
Currently extconf.rb constructs its own linker command-line options when using pg_config:
#!ruby
...
libdir = `"#{pgconfig}" --libdir`.chomp
if RbConfig::CONFIG["RPATHFLAG"].to_s.empty? && try_link('int main() {return 0;}', " -Wl,-rpath,#{libdir}")
$LDFLAGS << " -Wl,-rpath,#{libdir}"
end
...
This means this gem is explicitly tied to an object linker that accepts those arguments instead of gathering the information from pg_config properly via pg_config --ldflags
I believe this to be an error and bug. You have a command-line option to query what LDFLAGS should be set to, but are instead constructing your own tight coupling between the linker and the gem.
In my case, compiling on Solaris 10 SPARC with the native linker, everything built fine once I changed extconf.rb as above.
Thanks for your thoughts and attention
Original report by Jeff Blaine (Bitbucket: jblaine, GitHub: jblaine).
Currently
extconf.rbconstructs its own linker command-line options when usingpg_config:This means this gem is explicitly tied to an object linker that accepts those arguments instead of gathering the information from pg_config properly via
pg_config --ldflagsI believe this to be an error and bug. You have a command-line option to query what LDFLAGS should be set to, but are instead constructing your own tight coupling between the linker and the gem.
In my case, compiling on Solaris 10 SPARC with the native linker, everything built fine once I changed
extconf.rbas above.Thanks for your thoughts and attention