From 54c14279dc8714371ee303eeba39d77beeb6baff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Tue, 25 Sep 2018 13:11:14 +0000 Subject: [PATCH] Address more linker issues This resolves a ninja-related issues, corrects passing private args to linker while building libruby itself (without external LDFLAGS), exports the full symbols table, and pet 'pkg check -d'. Issues with weechat, vim, facter, rubygem-hpricot and rubygem-rdiscount should be fixed. See [1] for long story of hunting and fixing these issues. Bump PORTREVISIONS accordingly. PR: 230238 [1], 231361 Submitted by: fuffy Approved by: fuffy --- Mk/bsd.ruby.mk | 4 ++-- lang/ruby24/files/patch-configure.in | 11 ++++++++++- lang/ruby25/files/patch-configure.ac | 11 ++++++++++- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/Mk/bsd.ruby.mk b/Mk/bsd.ruby.mk index 9b4948ed68df..a30dc4a62c57 100644 --- a/Mk/bsd.ruby.mk +++ b/Mk/bsd.ruby.mk @@ -165,7 +165,7 @@ RUBY23= "" # PLIST_SUB helpers # Ruby 2.4 # RUBY_RELVERSION= 2.4.4 -RUBY_PORTREVISION= 3 +RUBY_PORTREVISION= 4 RUBY_PORTEPOCH= 1 RUBY_PATCHLEVEL= 0 RUBY24= "" # PLIST_SUB helpers @@ -175,7 +175,7 @@ RUBY24= "" # PLIST_SUB helpers # Ruby 2.5 # RUBY_RELVERSION= 2.5.1 -RUBY_PORTREVISION= 4 +RUBY_PORTREVISION= 5 RUBY_PORTEPOCH= 1 RUBY_PATCHLEVEL= 0 RUBY25= "" # PLIST_SUB helpers diff --git a/lang/ruby24/files/patch-configure.in b/lang/ruby24/files/patch-configure.in index fc717548afe3..b72fd938b61d 100644 --- a/lang/ruby24/files/patch-configure.in +++ b/lang/ruby24/files/patch-configure.in @@ -18,11 +18,20 @@ void *arg, int (*compar)(void *, const void *, const void *)); ],[ ], [rb_cv_bsd_qsort_r=yes], -@@ -3423,7 +3423,6 @@ +@@ -3423,7 +3423,7 @@ : ${LDSHARED='$(CC) -shared'} if test "$rb_cv_binary_elf" = yes; then LDFLAGS="$LDFLAGS -rdynamic" - DLDFLAGS="$DLDFLAGS "'-Wl,-soname,$@' ++ DLDFLAGS="$DLDFLAGS "'-Wl,-E' else test "$GCC" = yes && test "$rb_cv_prog_gnu_ld" = yes || LDSHARED='$(LD) -Bshareable' fi +@@ -3896,6 +3895,7 @@ + [freebsd*|dragonfly*], [ + SOLIBS='$(LIBS)' + LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)' ++ RUBY_APPEND_OPTIONS(LIBRUBY_DLDFLAGS, ['-Wl,-soname,${LIBRUBY_SO}']) + if test "$rb_cv_binary_elf" != "yes" ; then + LIBRUBY_SO="$LIBRUBY_SO.\$(TEENY)" + LIBRUBY_ALIASES='' diff --git a/lang/ruby25/files/patch-configure.ac b/lang/ruby25/files/patch-configure.ac index 200298eff208..08924ed4396a 100644 --- a/lang/ruby25/files/patch-configure.ac +++ b/lang/ruby25/files/patch-configure.ac @@ -18,11 +18,20 @@ void *arg, int (*compar)(void *, const void *, const void *)); ],[ ], [rb_cv_bsd_qsort_r=yes], -@@ -3245,7 +3245,6 @@ +@@ -3245,7 +3245,7 @@ : ${LDSHARED='$(CC) -shared'} AS_IF([test "$rb_cv_binary_elf" = yes], [ LDFLAGS="$LDFLAGS -rdynamic" - DLDFLAGS="$DLDFLAGS "'-Wl,-soname,$@' ++ DLDFLAGS="$DLDFLAGS "'-Wl,-E' ], [ test "$GCC" = yes && test "$rb_cv_prog_gnu_ld" = yes || LDSHARED='$(LD) -Bshareable' ]) +@@ -3724,6 +3723,7 @@ + SOLIBS='$(LIBS)' + LIBRUBY_SO='lib$(RUBY_SO_NAME).$(SOEXT).$(MAJOR)$(MINOR)' + LIBRUBY_SONAME='$(LIBRUBY_SO)' ++ RUBY_APPEND_OPTIONS(LIBRUBY_DLDFLAGS, ['-Wl,-soname,${LIBRUBY_SO}']) + AS_IF([test "$rb_cv_binary_elf" != "yes" ], [ + LIBRUBY_SO="$LIBRUBY_SO.\$(TEENY)" + LIBRUBY_ALIASES=''