Armando Blancas
unread,Apr 20, 2012, 7:23:51 PM4/20/12You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
gcc: i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
gsc: v4.6.4 20120210052234 i386-apple-darwin10.8.0 "./configure '--enable-single-host' '--enable-shared'"
os: Darwin 10.8.0 x86_64 i386
I've been trying to compile IrRegex 0.8.3 with the following commands as shown in section 3.4.3, page 18, Building a shared-library, with the following warning at the end:
$ gsc -c irregex.scm
$ gsc -link irregex.c
$ gsc -obj -cc-options "-D___SHARED" irregex.c
$ gcc -shared irregex.o -o irregex.so
ld: warning: in irregex.o, file was built for i386 which is not the architecture being linked (x86_64)
I tried to fix the problem by compiling with -arch x86_64, but then the problem is a lot of symbols not found:
gcc -arch x86_64 -no-cpp-precomp -Wno-unused -Wno-write-strings -O2 -fno-math-errno -fschedule-insns2 -fno-trapping-math -fno-strict-aliasing -fwrapv -fomit-frame-pointer -fno-move-loop-invariants -fPIC -fno-common -mieee-fp -D___SINGLE_HOST -I"/usr/local/Gambit-C/include" -o "irregex.o" -D___SHARED irregex.c
If, instead, I add the switch -arch i386 to the last command, I get some other symbols not found:
gcc -shared -arch i386 irregex.o -o irregex.so
Now, despite the warning in my first attempt, I actually got an .so file:
$ ls -l irregex.so
-rwxr-xr-x 1 ablancas staff 4168 Apr 20 16:06 irregex.so
So I wrote a test program to see if the new lib was usable and it turned out that the test program as well as libgambc.dylib produce the same warning.
~/xtra/hacks/scheme/scripting $ gsc -link irtest.scm
*** WARNING -- "irregex-replace" is not defined,
*** referenced in: ("/Users/ablancas/xtra/hacks/scheme/scripting/irtest.c")
*** WARNING -- "string->irregex" is not defined,
*** referenced in: ("/Users/ablancas/xtra/hacks/scheme/scripting/irtest.c")
~/xtra/hacks/scheme/scripting $ gsc -obj irtest.c irtest_.c
irtest.c:
irtest_.c:
$ gcc irtest.o irtest_.o irregex.so -lgambc -L/usr/local/Gambit-C/lib
ld: warning: in irtest.o, file was built for i386 which is not the architecture being linked (x86_64)
ld: warning: in irtest_.o, file was built for i386 which is not the architecture being linked (x86_64)
ld: warning: in /usr/local/Gambit-C/lib/libgambc.dylib, file was built for i386 which is not the architecture being linked (x86_64)
Undefined symbols:
"_main", referenced from:
start in crt1.10.6.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
At this point I'm stuck and will appreciate some help.