Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extconf.rb should use pg_config --ldflags not --libdir #164

Closed
ged opened this issue Jun 14, 2013 · 3 comments
Closed

extconf.rb should use pg_config --ldflags not --libdir #164

ged opened this issue Jun 14, 2013 · 3 comments

Comments

@ged
Copy link
Owner

ged commented Jun 14, 2013

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

@ged
Copy link
Owner Author

ged commented Jun 14, 2013

Original comment by Lars Kanis (Bitbucket: larskanis, GitHub: larskanis).


This is changed on master. Could you please clone ruby-pg from github or
bitbucket and try installing this?

@ged
Copy link
Owner Author

ged commented Jun 14, 2013

Original comment by Jeff Blaine (Bitbucket: jblaine, GitHub: jblaine).


Thanks for the reply. I've confirmed master builds fine just now.

@ged
Copy link
Owner Author

ged commented Jun 14, 2013

Original comment by Lars Kanis (Bitbucket: larskanis, GitHub: larskanis).


Great! I guess we'll release a new version within the next two Weeks.

@ged ged closed this as completed Jun 15, 2013
@ged ged added this to the Pending milestone Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant