Bug #1438

dylib architecture error building 1.9.1-rc2 on osx10.5.6

Added by mattmoss (Matthew Moss) about 3 years ago. Updated about 1 year ago.

[ruby-core:23372]
Status:Rejected Start date:05/07/2009
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:core
Target version:1.9.1 RC2
ruby -v:(miniruby) 1.9.1p0

Description

Attempting to build 1.9.1-rc2 on osx 10.5.6 in the following manner:

./configure --prefix=/usr/local --program-suffix=19 --enable-pthread --with-readline-dir=/usr/local --enable-shared
make



Much of the basic source builds just fine. After a while, though, I get the following:

ar rcu libruby19-static.a dln.o encoding.o prelude.o array.o bignum.o class.o compar.o complex.o dir.o enum.o enumerator.o error.o eval.o load.o proc.o file.o gc.o hash.o inits.o io.o marshal.o math.o numeric.o object.o pack.o parse.o process.o random.o range.o rational.o re.o regcomp.o regenc.o regerror.o regexec.o regparse.o regsyntax.o ruby.o safe.o signal.o sprintf.o st.o strftime.o string.o struct.o time.o transcode.o util.o variable.o version.o compile.o debug.o iseq.o vm.o vm_dump.o thread.o cont.o ascii.o us_ascii.o unicode.o utf_8.o newline.o lgamma_r.o  dmyext.o
cc -dynamiclib -undefined suppress -flat_namespace -install_name /usr/local/lib/libruby19.dylib -current_version 1.9.1 -compatibility_version 1.9   dln.o encoding.o prelude.o array.o bignum.o class.o compar.o complex.o dir.o enum.o enumerator.o error.o eval.o load.o proc.o file.o gc.o hash.o inits.o io.o marshal.o math.o numeric.o object.o pack.o parse.o process.o random.o range.o rational.o re.o regcomp.o regenc.o regerror.o regexec.o regparse.o regsyntax.o ruby.o safe.o signal.o sprintf.o st.o strftime.o string.o struct.o time.o transcode.o util.o variable.o version.o compile.o debug.o iseq.o vm.o vm_dump.o thread.o cont.o ascii.o us_ascii.o unicode.o utf_8.o newline.o lgamma_r.o  dmyext.o  -o libruby19.1.9.1.dylib
./miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb  ./tool/generic_erb.rb -c -o encdb.h ./template/encdb.h.tmpl ./enc enc
encdb.h updated
make -f enc.mk RUBY="./miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb " MINIRUBY="./miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb "  enc
gcc -I. -I.ext/include/i386-darwin9.6.0 -I./include -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -DONIG_ENC_REGISTER=rb_enc_register -fno-common  -O2 -g -Wall -Wno-parentheses  -fno-common -pipe -fno-common  -o enc/encdb.o -c enc/encdb.c
cc -dynamic -bundle -undefined suppress -flat_namespace -o .ext/i386-darwin9.6.0/enc/encdb.bundle enc/encdb.o -L. -L. -L. -L/usr/local/lib    -lruby19 -lpthread -ldl -lobjc  
ld: in /usr/local/lib/libstdc++.6.dylib, file is not of required architecture
collect2: ld returned 1 exit status
make[1]: *** [.ext/i386-darwin9.6.0/enc/encdb.bundle] Error 1

History

Updated by roberto (Ollivier Robert) about 3 years ago

Are you sure you don't want to link against /usr/lib/libstdc++.dylib instead?  Apparently the one is /usr/local/lib is either 64 bit or PPC...

Updated by mattmoss (Matthew Moss) about 3 years ago

Perhaps, but I'm just running 'make', not linking in that specifically. Or is that what --prefix=/usr/local implies in the 'configure' command? (My Unix/BSD kung-fu is not very strong.) I assumed that --prefix directed where the built products would be installed; is that wrong?

Updated by mattmoss (Matthew Moss) about 3 years ago

Okay, if I change line 40 of enc.mk from:
   LDFLAGS = -L. -L/usr/local/lib
to:
   LDFLAGS = -L. -L/usr/lib

Then it gets past that linking error, builds encdb.bundle, and moves on. It runs into the same error at the next attempt to link a .bundle (i.e. bigdecimal). So I'm wondering...

1. Is that really a legitimate change to LDFLAGS?
2. Do I need to go to all these modules and change LDFLAGS in a like manner?

Updated by nobu (Nobuyoshi Nakada) about 3 years ago

Hi,

At Thu, 7 May 2009 13:54:17 +0900,
Matthew Moss wrote in [ruby-core:23377]:
> 1. Is that really a legitimate change to LDFLAGS?

No.

> 2. Do I need to go to all these modules and change LDFLAGS in a like manner?

No.

You should uninstall the wrong library and install a correct
library.  Try `file /usr/local/lib/libstdc++.6.dylib' to check
what it is.

-- 
Nobu Nakada

Updated by nobu (Nobuyoshi Nakada) about 3 years ago

  • Status changed from Open to Rejected

Updated by mattmoss (Matthew Moss) about 3 years ago

Thanks Nobu...

Seems like the lib in /usr/local/lib is arm... I believe the iPhone SDK installation (w/Unix tools) put it there.

Also available in: Atom PDF