Bug 199048 - lang/ruby21: configure error: something wrong with LDFLAGS=" -Wl,-rpath,/usr/lib:/usr/local/lib
Summary: lang/ruby21: configure error: something wrong with LDFLAGS=" -Wl,-rpath,/usr/...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: arm Any
: --- Affects Some People
Assignee: freebsd-ruby (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-30 20:55 UTC by Ulrich Grey
Modified: 2015-11-10 09:36 UTC (History)
4 users (show)

See Also:


Attachments
patch to disable dtrace in ruby 2.1 on non x86 archs (465 bytes, patch)
2015-04-03 03:00 UTC, Steve Wills
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ulrich Grey 2015-03-30 20:55:54 UTC
From ruby-2.1.5/config.log:
-----------------
configure:7102: checking whether LDFLAGS is valid
configure:7115: cc -o conftest -O -pipe -mfloat-abi=softfp  -fno-strict-aliasing  -I/usr/local/include  -Wl,-rpath,/usr/lib:/usr/local/lib conftest.c -lpthread -L/usr/local/lib >&5
/usr/bin/ld: Warning: /usr/lib/crtbegin.o: Unknown EABI object attribute 34
/usr/bin/ld: Warning: /tmp/conftest-0e885a.o: Unknown EABI object attribute 34
/usr/bin/ld: Warning: /usr/lib/crtend.o: Unknown EABI object attribute 34
configure:7115: $? = 0
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define CANONICALIZATION_FOR_MATHN 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define __EXTENSIONS__ 1
| #define _ALL_SOURCE 1
| #define _GNU_SOURCE 1
| #define _POSIX_PTHREAD_SEMANTICS 1
| #define _TANDEM_SOURCE 1
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:7120: result: no
configure:7122: error: something wrong with LDFLAGS=" -Wl,-rpath,/usr/lib:/usr/local/lib"
Comment 1 Ulrich Grey 2015-03-30 21:05:57 UTC
 FreeBSD 11.0-CURRENT #0 r280772M
Comment 2 Steve Wills freebsd_committer freebsd_triage 2015-04-01 03:01:34 UTC
Can you tell me if you have anything in make.conf or src.conf or any local src or other changes that might be relevant? Also, are you building in poudriere and if so, include that config as well. Have you changed the default options for the port?

I don't get this error and I am also (by chance) running CURRENT r280772. Your source is patched, based on the r280772M in uname, but that may or may not be the source of the issue.

Since I can't reproduce the issue, I'm going to need more info.
Comment 3 Steve Wills freebsd_committer freebsd_triage 2015-04-01 04:11:31 UTC
I just noticed this is on arm hardware. I'm guessing this issue is arm specific. I don't have arm hardware, so I can't reproduce. I could setup qemu, but it's a bit of work so it will be a while before I get to it. In the mean time, are you building on native hardware or in qemu?
Comment 4 Ulrich Grey 2015-04-01 10:37:28 UTC
I am building on native arm hardware (wandboard-quad):

FreeBSD wqtest 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r280772M: Sat Mar 28 11:28:48 UTC 2015     gwgpi@wqtest:/usr/local/DEVEL/obj/usr/local/DEVEL/SRC/head/sys/WANDBOARD-QUAD  arm

There are no entries in make.conf and src.conf.

The kernel is built with: options ARM_NEW_PMAP.

I don't have changed the ports default options.
Comment 5 Mikael Urankar freebsd_committer freebsd_triage 2015-04-01 11:41:57 UTC
(In reply to Ulrich Grey from comment #4)
I think the problem is in gnu ld not the port itself, can you try https://reviews.freebsd.org/D2194
Comment 6 Ulrich Grey 2015-04-02 09:46:21 UTC
I have patched the source tree FreeBSD 11.0-CURRENT #0 r280772M with this patch: 

https://reviews.freebsd.org/D2194

I have built a new image (crochet, wandboard-quad) and rebuilt lang/ruby21 with all dependencies. Configure finished successfully, but the build hangs here:

--- probes.o ---
processing probes in object files
rm -f probes.o
dt_modtext:/usr/home/FREEBSD/freebsdCURRENTpatch/head/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c(831): DOODAD
...
dt_modtext:/usr/home/FREEBSD/freebsdCURRENTpatch/head/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c(831): DOODAD
prepare_elf32:/usr/home/FREEBSD/freebsdCURRENTpatch/head/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c(232): DOODAD
...
prepare_elf32:/usr/home/FREEBSD/freebsdCURRENTpatch/head/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c(232): DOODAD
--- miniruby ---
linking miniruby
--- .rbconfig.time ---
--- encdb.h ---
generating encdb.h

After > 1 hour I have interrupted the build.

ps auxww shows:
USER    PID %CPU %MEM   VSZ   RSS TT  STAT STARTED       TIME COMMAND
root   7264 83.8  0.3 13216  5336  2  R    09:36      3:47.36 ./miniruby -I./lib -I. -I.ext/common ./tool/mkconfig.rb -timestamp=.rbconfig.time -install_name=ruby21 -so_name=ruby21 rbconfig.rb
root   7266 81.6  0.3 13216  5336  2  R    09:36      4:52.64 ./miniruby -I./lib -I. -I.ext/common ./tool/generic_erb.rb -c -o encdb.h ./template/encdb.h.tmpl ./enc enc

This path:
dt_modtext:/usr/home/FREEBSD/freebsdCURRENTpatch/head/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c(831): DOODAD

does not come from the wandboard. It originates from the system, I build the image on.
Comment 7 Steve Wills freebsd_committer freebsd_triage 2015-04-03 03:00:27 UTC
Created attachment 155146 [details]
patch to disable dtrace in ruby 2.1 on non x86 archs

(In reply to Ulrich Grey from comment #6)

Looks dtrace related, try this patch.
Comment 8 Ulrich Grey 2015-04-03 08:39:24 UTC
(In reply to Steve Wills from comment #7)
I have applied the patch and now I get this:

--- miniruby ---
linking miniruby
--- .rbconfig.time ---
--- encdb.h ---
generating encdb.h
--- .rbconfig.time ---
./miniruby: [BUG] Bus Error at 0xbf3ffffc
ruby 2.1.5p273 (2014-11-13 revision 48405) [armv6-freebsd11]

-- Control frame information -----------------------------------------------
--- encdb.h ---
./miniruby: [BUG] Bus Error at 0xbf3ffffc
ruby 2.1.5p273 (2014-11-13 revision 48405) [armv6-freebsd11]

-- Control frame information -----------------------------------------------
c:0001 p:0000 s:0002 E:002104 TOP    [FINISH]

--- .rbconfig.time ---
c:0001 p:0000 s:0002 E:002104 TOP    [FINISH]


-- Other runtime information -----------------------------------------------

* Loaded script: ./miniruby

* Loaded features:

    0 enumerator.so

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

--- encdb.h ---

-- Other runtime information -----------------------------------------------

* Loaded script: ./miniruby

* Loaded features:

    0 enumerator.so

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

Abort trap (core dumped)
*** [encdb.h] Error code 134

make[2]: stopped in /usr/local/DEVEL/ports/lang/ruby21/work/ruby-2.1.5
--- .rbconfig.time ---
Abort trap (core dumped)
*** [.rbconfig.time] Error code 134

make[2]: stopped in /usr/local/DEVEL/ports/lang/ruby21/work/ruby-2.1.5
2 errors

make[2]: stopped in /usr/local/DEVEL/ports/lang/ruby21/work/ruby-2.1.5
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/local/DEVEL/ports/lang/ruby21
*** Error code 1

Stop.
make: stopped in /usr/local/DEVEL/ports/lang/ruby21
Comment 9 Mikael Urankar freebsd_committer freebsd_triage 2015-04-03 12:59:10 UTC
looks like a clang problem as it builds fine with gcc
Comment 10 Ulrich Grey 2015-04-03 23:32:39 UTC
(In reply to mikael.urankar from comment #9)
I have compiled lang/ruby21 with lang/gcc5. I have used the patch to disable dtrace in ruby 2.1 (see comment #7). The build finished successfully.
Comment 11 Ulrich Grey 2015-04-03 23:49:22 UTC
Now I have compiled lang/ruby21 with lang/gcc5 with the original ruby21/Makefile (enabled dtrace). This time I get an error:

===>  Building for ruby-2.1.5_2,1
--- showflags ---
--- dln.o ---
--- localeinit.o ---
--- probes.h ---
CC = gcc5
	LD = /usr/local/bin/ld
	LDSHARED = gcc5 -shared
	CFLAGS = -O -pipe -mfloat-abi=softfp  -Wl,-rpath=/usr/local/lib/gcc5 -fno-strict-aliasing -fPIC 
	XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT
	CPPFLAGS = -I/usr/local/include   -I. -I.ext/include/armv6-freebsd11 -I./include -I.
	DLDFLAGS = -Wl,-soname,libruby21.so.21 -fstack-protector  
	SOLIBS = -lelf -lgmp -lcrypt -lm -lpthread -L/usr/local/lib 

...

processing probes in object files
rm -f probes.o
<jemalloc>: /usr/home/FREEBSD/freebsdCURRENTpatch/head/lib/libc/../../contrib/jemalloc/include/jemalloc/internal/arena.h:990: Failed assertion: "arena_mapbits_allocated_get(chunk, pageind) != 0"
dt_modtext:/usr/home/FREEBSD/freebsdCURRENTpatch/head/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c(831): DOODAD
dt_modtext:/usr/home/FREEBSD/freebsdCURRENTpatch/head/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c(831): DOODAD
dt_modtext:/usr/home/FREEBSD/freebsdCURRENTpatch/head/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c(831): DOODAD
dt_modtext:/usr/home/FREEBSD/freebsdCURRENTpatch/head/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c(831): DOODAD
Abort trap (core dumped)
*** [probes.o] Error code 134

make[2]: stopped in /usr/local/DEVEL/ports/lang/ruby21/work/ruby-2.1.5
1 error

make[2]: stopped in /usr/local/DEVEL/ports/lang/ruby21/work/ruby-2.1.5
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/local/DEVEL/ports/lang/ruby21
*** Error code 1

Stop.
make: stopped in /usr/local/DEVEL/ports/lang/ruby21
Comment 12 Ulrich Grey 2015-04-04 09:03:07 UTC
(In reply to Ulrich Grey from comment #10)
Here is the output of make test:

root@wqtest:/usr/local/DEVEL/ports/lang/ruby21/work/ruby-2.1.5 # make test
	CC = gcc5
	LD = /usr/local/bin/ld
	LDSHARED = gcc5 -shared
	CFLAGS = -O -pipe -mfloat-abi=softfp  -Wl,-rpath=/usr/local/lib/gcc5 -fno-strict-aliasing -fPIC 
	XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT
	CPPFLAGS = -I/usr/local/include   -I. -I.ext/include/armv6-freebsd11 -I./include -I.
	DLDFLAGS = -Wl,-soname,libruby21.so.21 -fstack-protector  
	SOLIBS = -lgmp -lcrypt -lm -lpthread -L/usr/local/lib 
Using built-in specs.
COLLECT_GCC=gcc5
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc5/gcc/armv6-portbld-freebsd11.0/5.0.0/lto-wrapper
Target: armv6-portbld-freebsd11.0
Configured with: ./../gcc-5-20150322/configure --with-build-config=bootstrap-debug --disable-nls --enable-gnu-indirect-function --libdir=/usr/local/lib/gcc5 --libexecdir=/usr/local/libexec/gcc5 --program-suffix=5 --with-as=/usr/local/bin/as --with-gmp=/usr/local --with-gxx-include-dir=/usr/local/lib/gcc5/include/c++/ --with-ld=/usr/local/bin/ld --with-pkgversion='FreeBSD Ports Collection' --with-system-zlib --disable-libgcj --enable-languages=c,c++,objc,fortran --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/gcc5 --build=armv6-portbld-freebsd11.0
Thread model: posix
gcc version 5.0.0 20150322 (experimental) (FreeBSD Ports Collection) 
./tool/rubytest.rb:20: warning: Insecure world writable dir /usr/local/DEVEL in PATH, mode 040777
sample/test.rb:system  /usr/local/DEVEL/ports/lang/ruby21/work/ruby-2.1.5/sample/test.rb:1970: warning: Insecure world writable dir /usr/local/DEVEL in PATH, mode 040777                                                                   O
test succeeded
PASS all 1008 tests
./miniruby -I./lib -I. -I.ext/common  ./tool/runruby.rb --extout=.ext  -- --disable-gems "./bootstraptest/runner.rb" --ruby="ruby21 --disable-gems"   ./KNOWNBUGS.rb
2015-04-04 08:59:45 +0000
Driver is ruby 2.1.5p273 (2014-11-13 revision 48405) [armv6-freebsd11]
./bootstraptest/runner.rb:156: warning: Insecure world writable dir /usr/local/DEVEL in PATH, mode 040777
Target is ruby 2.1.5p273 (2014-11-13 revision 48405) [armv6-freebsd11]

KNOWNBUGS.rbPASS 0
No tests, no problem
Comment 13 Mikael Urankar freebsd_committer freebsd_triage 2015-04-14 18:44:54 UTC
Adding --with-setjmp-type=_setjmp to configure fixed the clang problem.

I don't know if this bug report is related to our issue on ARM:
https://bugs.ruby-lang.org/issues/10438
and http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48184 for the fix

.if ${ARCH} == "armv6" || ${ARCH} == "armv6hf"
CONFIGURE_ARGS+=        --with-setjmp-type=_setjmp
.endif
Comment 14 Ulrich Grey 2015-04-14 21:21:20 UTC
(In reply to mikael.urankar from comment #13)

I have built ruby-2.1.6 with:

.if ${ARCH} == "armv6" || ${ARCH} == "armv6hf"
CONFIGURE_ARGS+=        --with-setjmp-type=_setjmp
.endif

added to the Makefile. The build finished successfully (FreeBSD 11.0-CURRENT #1 r281266M arm on a wandboard-quad).
Here is the output of make test:

root@wqtest:/usr/ports/lang/ruby21/work/ruby-2.1.6 # make test
	CC = cc
	LD = ld
	LDSHARED = cc -shared
	CFLAGS = -O -pipe -mfloat-abi=softfp  -fno-strict-aliasing -fPIC 
	XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT
	CPPFLAGS = -I/usr/local/include   -I. -I.ext/include/armv6-freebsd11 -I./include -I.
	DLDFLAGS = -Wl,-soname,libruby21.so.21 -fstack-protector  
	SOLIBS = -lexecinfo -lgmp -lcrypt -lm -lpthread -L/usr/local/lib 
FreeBSD clang version 3.6.0 (tags/RELEASE_360/final 230434) 20150225
Target: armv6--freebsd11.0-gnueabi
Thread model: posix
./tool/rubytest.rb:20: warning: Insecure world writable dir /usr/local/DEVEL in PATH, mode 040777
sample/test.rb:system  /usr/local/DEVEL/ports/lang/ruby21/work/ruby-2.1.6/sample/test.rb:1970: warning: Insecure world writable dir /usr/local/DEVEL in PATH, mode 040777                                                                   O
test succeeded
PASS all 1008 tests
./miniruby -I./lib -I. -I.ext/common  ./tool/runruby.rb --extout=.ext  -- --disable-gems "./bootstraptest/runner.rb" --ruby="ruby21 --disable-gems"   ./KNOWNBUGS.rb
2015-04-14 21:12:33 +0000
Driver is ruby 2.1.6p336 (2015-04-13 revision 50298) [armv6-freebsd11]
./bootstraptest/runner.rb:156: warning: Insecure world writable dir /usr/local/DEVEL in PATH, mode 040777
Target is ruby 2.1.6p336 (2015-04-13 revision 50298) [armv6-freebsd11]

KNOWNBUGS.rbPASS 0
No tests, no problem
root@wqtest:/usr/ports/lang/ruby21/work/ruby-2.1.6 #
Comment 15 Michael Moll freebsd_committer freebsd_triage 2015-11-09 14:53:16 UTC
I guess this OK to close since r384323?
Comment 16 Mikael Urankar freebsd_committer freebsd_triage 2015-11-10 09:20:27 UTC
(In reply to Michael Moll from comment #15)
Yes it can be closed:
http://beefy8.nyi.freebsd.org/data/head-armv6-default/p400328_s290048/logs/ruby-2.1.7,1.log
Comment 17 Michael Moll freebsd_committer freebsd_triage 2015-11-10 09:36:02 UTC
fixed