[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Loadable modules with FSF compilers on Darwin MacOS X
From: |
Bill Northcott |
Subject: |
Loadable modules with FSF compilers on Darwin MacOS X |
Date: |
Tue, 17 Jul 2007 16:00:28 +1000 |
There is a problem building loadable modules on Darwin/MacOS X using
libtool and FSF compilers.
A typical build failure looks like this:
/bin/sh ../../../libtool --tag=CXX --mode=link /usr/local/gcc4.0/
bin/g++ -g -O2 -o basefunctions.la -rpath /usr/local/lib/jags/
modules -no-undefined -module -avoid-version basefunctions_la-
Add.lo basefunctions_la-Divide.lo basefunctions_la-Equals.lo
basefunctions_la-Multiply.lo basefunctions_la-Neg.lo
basefunctions_la-Pow.lo basefunctions_la-Subtract.lo
basefunctions_la-module.lo ../../../src/lib/libjags.la -lm
/usr/local/gcc4.0/bin/g++ -o .libs/basefunctions.so -bundle .libs/
basefunctions_la-Add.o .libs/basefunctions_la-Divide.o .libs/
basefunctions_la-Equals.o .libs/basefunctions_la-Multiply.o .libs/
basefunctions_la-Neg.o .libs/basefunctions_la-Pow.o .libs/
basefunctions_la-Subtract.o .libs/basefunctions_la-
module.o ../../../src/lib/.libs/libjags.dylib -lm
i686-apple-darwin8-g++-4.0.3: couldn't run '/usr/local/gcc4.0/bin/
undle-gcc-4.0.3': No such file or directory
There is always some complaint about a missing file or directory
whose name starts with 'undle'.
The immediate cause can be seen in the g++ command above where '-
bundle' is the second option. Unless -bundle is the first option on
the command line, it is interpreted as '-b undle' which causes the
errors.
In the package concerned the cause seems to be around line 220 of the
configured libtool where one finds:
module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs
\$deplibs\$compiler_flags"
module_expsym_cmds="sed -e \\\"s,#.*,,\\\" -e \\\"s,^[ ]*,,\\\" -
e \\\"s,^\\\\(..*\\\\),_&,\\\" < \$export_symbols > \$output_objdir/
\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -
bundle \$libobjs \$deplibs\$compiler_flags~nmedit -s \
$output_objdir/\${libname}-symbols.expsym \${lib}"
Of course it is easy enough to rearrange those lines and get it to
build, but it seems to me like a bug in libtool. Alternatively, it
is a bug in the compiler, although I think it is documented somewhere.
The version here is 1.5.22 on MacOS X 10.4.10 Intel using the gcc
compilers distributed with R-2.4.1.
Using Apple's compilers there does not seem to be the same issue
maybe they require -b to be followed by a space.
I know I am not the only one to hit this problem.
Bill Northcott
- Loadable modules with FSF compilers on Darwin MacOS X,
Bill Northcott <=