digitalmars.D.learn - creating a .so with gdc
- Carlos Santander (8/8) May 03 2007 Can somebody explain for the n-th time how to create a .so with GDC? Her...
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (10/19) May 04 2007 I haven't created a shared library with GDC, but the shared (.so) files
- Carlos Santander (5/29) May 04 2007 Weird...
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (3/9) May 04 2007 Which compiler are you using ? (I'm using the regular Mac OS X 10.4 one)
- Carlos Santander (22/34) May 04 2007 $ gdc -v
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (13/22) May 04 2007 OK, if you are using the FSF version of GCC it probably doesn't know
- Carlos Santander (10/27) May 04 2007 I downloaded Apple's version:
Can somebody explain for the n-th time how to create a .so with GDC? Here's what I'm getting: $ gdc -fshared -Wl,-soname,libfoo.so -o libfoo.so foo.o /usr/bin/ld: unknown flag: -soname collect2: ld returned 1 exit status That's on Mac OS X. How about also setting up a wiki page so it's easy to find? -- Carlos Santander Bernal
May 03 2007
Carlos Santander wrote:Can somebody explain for the n-th time how to create a .so with GDC? Here's what I'm getting: $ gdc -fshared -Wl,-soname,libfoo.so -o libfoo.so foo.o /usr/bin/ld: unknown flag: -soname collect2: ld returned 1 exit status That's on Mac OS X. How about also setting up a wiki page so it's easy to find?I haven't created a shared library with GDC, but the shared (.so) files on other platforms are known as either dynamiclib or bundle on Mac OS X. Dynamic libraries are for linking to and bundles for loading at runtime, for instance program plugins and modules for Perl or Python are bundles. Using -soname should be equivalent to -install_name on Mac OS X. See: http://developer.apple.com/documentation/developertools/gcc-4.0.1/gcc/Darwin-Options.html $ gcc -dynamiclib -Wl,-install_name,libfoo.dylib -o libfoo.dylib foo.o But my GDC says cc1d: error: unrecognized command line option "-fshared" --anders
May 04 2007
Anders F Björklund escribió:Carlos Santander wrote:Weird... /usr/bin/ld: -i argument: nstall_name must have a ':' between its symbol names -- Carlos Santander BernalCan somebody explain for the n-th time how to create a .so with GDC? Here's what I'm getting: $ gdc -fshared -Wl,-soname,libfoo.so -o libfoo.so foo.o /usr/bin/ld: unknown flag: -soname collect2: ld returned 1 exit status That's on Mac OS X. How about also setting up a wiki page so it's easy to find?I haven't created a shared library with GDC, but the shared (.so) files on other platforms are known as either dynamiclib or bundle on Mac OS X. Dynamic libraries are for linking to and bundles for loading at runtime, for instance program plugins and modules for Perl or Python are bundles. Using -soname should be equivalent to -install_name on Mac OS X. See: http://developer.apple.com/documentation/developertools/gcc-4.0.1/gcc Darwin-Options.html $ gcc -dynamiclib -Wl,-install_name,libfoo.dylib -o libfoo.dylib foo.o But my GDC says cc1d: error: unrecognized command line option "-fshared" --anders
May 04 2007
Carlos Santander wrote:Which compiler are you using ? (I'm using the regular Mac OS X 10.4 one) --anders$ gcc -dynamiclib -Wl,-install_name,libfoo.dylib -o libfoo.dylib foo.o But my GDC says cc1d: error: unrecognized command line option "-fshared"Weird... /usr/bin/ld: -i argument: nstall_name must have a ':' between its symbol
May 04 2007
Anders F Björklund escribió:Carlos Santander wrote:$ gdc -v Using built-in specs. Target: powerpc-apple-darwin8.8.0 Configured with: ../gcc-4.1.1/configure --disable-multilib --enable-languages=c,d Thread model: posix gcc version 4.1.1 20060524 ( (gdc 0.23, using dmd 1.007)) $ gcc -v Using built-in specs. Target: powerpc-apple-darwin8 Configured with: /private/var/tmp/gcc/gcc-5247.obj~4/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --build=powerpc-apple-darwin8 --host=powerpc-apple-darwin8 --target=powerpc-apple-darwin8 Thread model: posix gcc version 4.0.1 (Apple Computer, Inc. build 5247) $ ld -v Apple Computer, Inc. version cctools-590.18.obj~10 -- Carlos Santander BernalWhich compiler are you using ? (I'm using the regular Mac OS X 10.4 one) --anders$ gcc -dynamiclib -Wl,-install_name,libfoo.dylib -o libfoo.dylib foo.o But my GDC says cc1d: error: unrecognized command line option "-fshared"Weird... /usr/bin/ld: -i argument: nstall_name must have a ':' between its symbol
May 04 2007
Carlos Santander wrote:OK, if you are using the FSF version of GCC it probably doesn't know about the various linker flags for Darwin - those are Apple specials. $ gdc -v ... gcc version 4.0.1 (Apple Computer, Inc. build 5363) (gdc 0.23, using dmd 1.007) $ gcc -v ... gcc version 4.0.1 (Apple Computer, Inc. build 5367) Apple hasn't released the source codes to Xcode 2.4.1 just yet, that's why the difference in the build numbers (gcc-5363 was from Xcode 2.4) --andersWhich compiler are you using ? (I'm using the regular Mac OS X 10.4 one)$ gdc -v Using built-in specs. Target: powerpc-apple-darwin8.8.0 Configured with: ../gcc-4.1.1/configure --disable-multilib --enable-languages=c,d Thread model: posix gcc version 4.1.1 20060524 ( (gdc 0.23, using dmd 1.007))
May 04 2007
Anders F Björklund escribió:OK, if you are using the FSF version of GCC it probably doesn't know about the various linker flags for Darwin - those are Apple specials. $ gdc -v .... gcc version 4.0.1 (Apple Computer, Inc. build 5363) (gdc 0.23, using dmd 1.007) $ gcc -v .... gcc version 4.0.1 (Apple Computer, Inc. build 5367) Apple hasn't released the source codes to Xcode 2.4.1 just yet, that's why the difference in the build numbers (gcc-5363 was from Xcode 2.4) --andersI downloaded Apple's version: gcc version 4.0.1 (Apple Computer, Inc. build 5341) (gdc 0.23, using dmd 1.007) But I get the same thing: /usr/bin/ld: -i argument: nstall_name must have a ':' between its symbol names And I guess that makes sense because it's ld that's failing, not gcc. $ /usr/bin/ld -v Apple Computer, Inc. version cctools-590.18.obj~10 -- Carlos Santander Bernal
May 04 2007