Bug #8595

mkmf.rb pkg_config modifies $LDFLAGS

Added by Shota Fukumori 10 months ago. Updated 10 months ago.

[ruby-core:55752]
Status:Closed
Priority:Normal
Assignee:Nobuyoshi Nakada
Category:-
Target version:-
ruby -v:ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux] Backport:1.9.3: DONTNEED, 2.0.0: DONE

Description

=begin
mkmf.rb's pkg_config modifies $LDFLAGS after 2.0.0 (r35605 ?) like the following:

# ruby 1.9.3p392 (2013-02-22 revision 39386) [x8664-linux]
p $LDFLAGS #=> "-L. -rdynamic -Wl,-export-dynamic"
p pkg
config('libxml-2.0') #=> ["-I/usr/include/libxml2 ", "", "-lxml2 "]
p $LDFLAGS #=> "-L. -rdynamic -Wl,-export-dynamic "

# ruby 2.0.0p247 (2013-06-27 revision 41674) [x8664-linux]
p $LDFLAGS #=> "-L. -fstack-protector -rdynamic -Wl,-export-dynamic"
p pkg
config('libxml-2.0') #=> ["-I/usr/include/libxml2", "", "-lxml2"]
p $LDFLAGS #=> "-lxml2 "

# 2.0.0 + my patch
p $LDFLAGS #=> "-L. -fstack-protector -rdynamic -Wl,-export-dynamic"
p pkg_config('libxml-2.0') #=> ["-I/usr/include/libxml2", "", "-lxml2"]
p $LDFLAGS #=> "-L. -fstack-protector -rdynamic -Wl,-export-dynamic "

attached patch fixes this to 1.9.3 behaviour.

I'll commit this if there's no problem.

=end

a.patch Magnifier (826 Bytes) Shota Fukumori, 07/02/2013 11:07 AM

b.patch Magnifier (1.23 KB) Shota Fukumori, 07/02/2013 11:20 AM


Related issues

Related to Backport200 - Backport #8596: r41734 Closed 07/02/2013

Associated revisions

Revision 41734
Added by Shota Fukumori 10 months ago

  • lib/mkmf.rb (try_config): Fix to not replace $LDFLAGS with $libs (1.9.3 behavior) [Bug #8595]

History

#1 Updated by Shota Fukumori 10 months ago

  • Description updated (diff)
  • ruby -v changed from ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.3.0] to ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]

#2 Updated by Shota Fukumori 10 months ago

oops, sorry, forgot to attach the patch

#3 Updated by Shota Fukumori 10 months ago

Updating patch because I uploaded older one:

  • Don't append libs into $LDFLAGS

#4 Updated by Shota Fukumori 10 months ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r41734.
Shota, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • lib/mkmf.rb (try_config): Fix to not replace $LDFLAGS with $libs (1.9.3 behavior) [Bug #8595]

#5 Updated by Shota Fukumori 10 months ago

  • Backport changed from 1.9.3: UNKNOWN, 2.0.0: UNKNOWN to 1.9.3: DONTNEED, 2.0.0: REQUIRED

#6 Updated by Tomoyuki Chikanaga 10 months ago

  • Backport changed from 1.9.3: DONTNEED, 2.0.0: REQUIRED to 1.9.3: DONTNEED, 2.0.0: DONE

Also available in: Atom PDF