Package: ruby2.0
Version: 2.0.0.247-1
Severity: important
Tags: upstream patch

Hi!

When building ruby-nokogiri extension for ruby2.0, I noticed that the
hardening linker flags were not passed when building the Makefile with
extconf/mkmf.

A change in the code of lib/mkmf.rb from ruby1.9.3 to ruby2.0 is causing
this, thus affecting all extension that are going to be built against
ruby2.0.

This has been fixed upstream with the following commit:

https://github.com/ruby/ruby/commit/47434dc12f90431fabfc7e9b1829ee0437bdee0a.patch

An adapted version of this patch against the Git repo of the Debian
package is attached.

Cheers,

Cédric



-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'testing'), (150, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.10-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages ruby2.0 depends on:
ii  libc6                 2.17-92+b1
ii  libruby2.0            2.0.0.247-1
ii  rubygems-integration  1.2

ruby2.0 recommends no packages.

ruby2.0 suggests no packages.

-- no debconf information
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index d4d5846..6fec4bd 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -1709,12 +1709,13 @@ SRC
       # default to package specific config command, as a last resort.
       get = proc {|opt| `#{pkgconfig} --#{opt}`.strip}
     end
+    orig_ldflags = $LDFLAGS
     if get and try_ldflags(ldflags = get['libs'])
       cflags = get['cflags']
       libs = get['libs-only-l']
       ldflags = (Shellwords.shellwords(ldflags) - Shellwords.shellwords(libs)).quote.join(" ")
       $CFLAGS += " " << cflags
-      $LDFLAGS += " " << ldflags
+      $LDFLAGS = [orig_ldflags, ldflags].join(' ')
       $libs += " " << libs
       Logging::message "package configuration for %s\n", pkg
       Logging::message "cflags: %s\nldflags: %s\nlibs: %s\n\n",

Attachment: signature.asc
Description: Digital signature

Reply via email to