Building file 4.26: duplicate symbol?

Jay Levitt lists-macports at shopwatch.org
Fri Sep 12 06:40:05 PDT 2008


The MacPorts "file" port has no maintainer, and is still at 4.25, although 
file 4.26 has been released (http://www.darwinsys.com/file/).  I'd be happy 
to try my hand at maintaining the port, but I can't actually seem to build 
the thing.  So this isn't a MacPorts question, per se, but I'm hoping 
someone has run into this while building other not-designed-for-Mac 
software.  I've asked on the "file" list, but there's very little volume 
there, and I don't know if any of the authors even has a Mac.

The problem:

When building file 4.26, on OS X 10.5.4 Leopard, I get a duplicate symbol 
error from ld.  I don't know enough about object modules to debug unaided, 
but if someone can let me know how to troubleshoot this, I'm happy to dig 
further.

4.25 builds fine on the same machine; 4.26 builds on my Fedora machine.  I 
also tried:

make distclean
autoreconf
./configure
make

but the same thing happened. There's an interesting bug at 
http://issues.sxemacs.org/show_bug.cgi?id=42 which may be related; 
apparently Apple's gcc does something different with inlines and C99?  My 
C-fu is rusty (and predates C99).

The error:

ld: duplicate symbol _li in .libs/apprentice.o and .libs/magic.o

Toolchain (copyrights snipped):

macpro% gcc --version
i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5465)
macpro% ld -v
@(#)PROGRAM:ld  PROJECT:ld64-77
macpro% m4 --version
GNU M4 1.4.6
macpro% make --version
GNU Make 3.81

The full configure/make output:

macpro% ./configure
checking for a BSD-compatible install... /opt/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /opt/local/bin/gmkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for builtin ELF support... yes
checking for ELF core file support... yes
checking for file formats in man section 5... no
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking whether gcc and cc understand -c and -o together... yes
checking for a BSD-compatible install... /opt/local/bin/ginstall -c
checking whether ln -s works... yes
checking build system type... i386-apple-darwin9.4.0
checking host system type... i386-apple-darwin9.4.0
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ld used by gcc... /usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld
checking if the linker (/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld) is GNU 
ld... no
checking for /usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld option to reload 
object files... -r
checking for BSD-compatible nm... /usr/bin/nm -p
checking how to recognise dependent libraries... pass_all
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for g77... no
checking for xlf... no
checking for f77... no
checking for frt... no
checking for pgf77... no
checking for cf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for xlf90... no
checking for f90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for gfortran... no
checking for g95... no
checking for xlf95... no
checking for f95... no
checking for fort... no
checking for ifort... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for ftn... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether  accepts -g... no
checking the maximum length of command line arguments... 196608
checking command to parse /usr/bin/nm -p output from gcc object... rm: 
conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
checking if gcc static flag  works... rm: conftest.dSYM: is a directory
yes
checking if gcc supports -fno-rtti -fno-exceptions... rm: conftest.dSYM: is 
a directory
no
checking for gcc option to produce PIC... -fno-common
checking if gcc PIC flag -fno-common works... rm: conftest.dSYM: is a directory
yes
checking if gcc supports -c -o file.o... rm: conftest.dSYM: is a directory
yes
checking whether the gcc linker 
(/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin9.4.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
configure: creating libtool
appending configuration tag "CXX" to libtool
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
checking for ld used by g++... /usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld
checking if the linker (/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld) is GNU 
ld... no
checking whether the g++ linker 
(/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fno-common
checking if g++ PIC flag -fno-common works... rm: conftest.dSYM: is a directory
yes
checking if g++ supports -c -o file.o... rm: conftest.dSYM: is a directory
yes
checking whether the g++ linker 
(/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin9.4.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
appending configuration tag "F77" to libtool
checking for ANSI C header files... (cached) yes
checking whether sys/types.h defines makedev... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for stdint.h... (cached) yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking for stdint.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for unistd.h... (cached) yes
checking utime.h usability... yes
checking utime.h presence... yes
checking for utime.h... yes
checking wchar.h usability... yes
checking wchar.h presence... yes
checking for wchar.h... yes
checking wctype.h usability... yes
checking wctype.h presence... yes
checking for wctype.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking err.h usability... yes
checking err.h presence... yes
checking for err.h... yes
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking for sys/stat.h... (cached) yes
checking for sys/types.h... (cached) yes
checking sys/utime.h usability... no
checking sys/utime.h presence... no
checking for sys/utime.h... no
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for an ANSI C-conforming const... yes
checking for off_t... yes
checking for size_t... yes
checking for struct stat.st_rdev... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for tm_zone in struct tm... yes
checking for tzname... yes
checking for tm_isdst in struct tm... yes
checking for daylight... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
rm: conftest.dSYM: is a directory
checking for _LARGEFILE_SOURCE value needed for large files... no
rm: conftest.dSYM: is a directory
checking for mbstate_t... yes
checking for uint8_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for int32_t... yes
checking for uint64_t... yes
checking for int64_t... yes
checking for long long... yes
checking size of long long... 8
checking for gcc compiler warnings... yes
checking for mmap... yes
checking for strerror... yes
checking for strndup... no
checking for strtoul... yes
checking for mbrtowc... yes
checking for mkstemp... yes
checking for utimes... yes
checking for utime... yes
checking for wcwidth... yes
checking for strtof... yes
checking for getopt_long... yes
checking for asprintf... yes
checking for vasprintf... yes
checking for gzopen in -lz... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating magic/Makefile
config.status: creating tests/Makefile
config.status: creating doc/Makefile
config.status: creating python/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
macpro% make
make  all-recursive
Making all in src
/bin/sh ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. 
-DMAGIC='"/usr/local/share/file/magic"'  -Wall -Wstrict-prototypes 
-Wmissing-prototypes -Wpointer-arith        -Wmissing-declarations 
-Wredundant-decls -Wnested-externs        -Wsign-compare -Wreturn-type 
-Wswitch -Wshadow        -Wcast-qual -Wwrite-strings -Wextra 
-Wunused-parameter -g -O2 -MT magic.lo -MD -MP -MF .deps/magic.Tpo -c -o 
magic.lo magic.c
mkdir .libs
gcc -DHAVE_CONFIG_H -I. -I.. -DMAGIC=\"/usr/local/share/file/magic\" -Wall 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-Wmissing-declarations -Wredundant-decls -Wnested-externs -Wsign-compare 
-Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra 
-Wunused-parameter -g -O2 -MT magic.lo -MD -MP -MF .deps/magic.Tpo -c 
magic.c  -fno-common -DPIC -o .libs/magic.o
gcc -DHAVE_CONFIG_H -I. -I.. -DMAGIC=\"/usr/local/share/file/magic\" -Wall 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-Wmissing-declarations -Wredundant-decls -Wnested-externs -Wsign-compare 
-Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra 
-Wunused-parameter -g -O2 -MT magic.lo -MD -MP -MF .deps/magic.Tpo -c 
magic.c -o magic.o >/dev/null 2>&1
mv -f .deps/magic.Tpo .deps/magic.Plo
/bin/sh ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. 
-DMAGIC='"/usr/local/share/file/magic"'  -Wall -Wstrict-prototypes 
-Wmissing-prototypes -Wpointer-arith        -Wmissing-declarations 
-Wredundant-decls -Wnested-externs        -Wsign-compare -Wreturn-type 
-Wswitch -Wshadow        -Wcast-qual -Wwrite-strings -Wextra 
-Wunused-parameter -g -O2 -MT apprentice.lo -MD -MP -MF .deps/apprentice.Tpo 
-c -o apprentice.lo apprentice.c
gcc -DHAVE_CONFIG_H -I. -I.. -DMAGIC=\"/usr/local/share/file/magic\" -Wall 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-Wmissing-declarations -Wredundant-decls -Wnested-externs -Wsign-compare 
-Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra 
-Wunused-parameter -g -O2 -MT apprentice.lo -MD -MP -MF .deps/apprentice.Tpo 
-c apprentice.c  -fno-common -DPIC -o .libs/apprentice.o
apprentice.c: In function 'load_1':
apprentice.c:1699: warning: 'slen' may be used uninitialized in this function
gcc -DHAVE_CONFIG_H -I. -I.. -DMAGIC=\"/usr/local/share/file/magic\" -Wall 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-Wmissing-declarations -Wredundant-decls -Wnested-externs -Wsign-compare 
-Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra 
-Wunused-parameter -g -O2 -MT apprentice.lo -MD -MP -MF .deps/apprentice.Tpo 
-c apprentice.c -o apprentice.o >/dev/null 2>&1
mv -f .deps/apprentice.Tpo .deps/apprentice.Plo
/bin/sh ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. 
-DMAGIC='"/usr/local/share/file/magic"'  -Wall -Wstrict-prototypes 
-Wmissing-prototypes -Wpointer-arith        -Wmissing-declarations 
-Wredundant-decls -Wnested-externs        -Wsign-compare -Wreturn-type 
-Wswitch -Wshadow        -Wcast-qual -Wwrite-strings -Wextra 
-Wunused-parameter -g -O2 -MT softmagic.lo -MD -MP -MF .deps/softmagic.Tpo 
-c -o softmagic.lo softmagic.c
gcc -DHAVE_CONFIG_H -I. -I.. -DMAGIC=\"/usr/local/share/file/magic\" -Wall 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-Wmissing-declarations -Wredundant-decls -Wnested-externs -Wsign-compare 
-Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra 
-Wunused-parameter -g -O2 -MT softmagic.lo -MD -MP -MF .deps/softmagic.Tpo 
-c softmagic.c  -fno-common -DPIC -o .libs/softmagic.o
softmagic.c: In function 'mcopy':
softmagic.c:848: warning: format '%zu' expects type 'size_t', but argument 3 
has type 'uint32_t'
gcc -DHAVE_CONFIG_H -I. -I.. -DMAGIC=\"/usr/local/share/file/magic\" -Wall 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-Wmissing-declarations -Wredundant-decls -Wnested-externs -Wsign-compare 
-Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra 
-Wunused-parameter -g -O2 -MT softmagic.lo -MD -MP -MF .deps/softmagic.Tpo 
-c softmagic.c -o softmagic.o >/dev/null 2>&1
mv -f .deps/softmagic.Tpo .deps/softmagic.Plo
/bin/sh ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. 
-DMAGIC='"/usr/local/share/file/magic"'  -Wall -Wstrict-prototypes 
-Wmissing-prototypes -Wpointer-arith        -Wmissing-declarations 
-Wredundant-decls -Wnested-externs        -Wsign-compare -Wreturn-type 
-Wswitch -Wshadow        -Wcast-qual -Wwrite-strings -Wextra 
-Wunused-parameter -g -O2 -MT ascmagic.lo -MD -MP -MF .deps/ascmagic.Tpo -c 
-o ascmagic.lo ascmagic.c
gcc -DHAVE_CONFIG_H -I. -I.. -DMAGIC=\"/usr/local/share/file/magic\" -Wall 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-Wmissing-declarations -Wredundant-decls -Wnested-externs -Wsign-compare 
-Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra 
-Wunused-parameter -g -O2 -MT ascmagic.lo -MD -MP -MF .deps/ascmagic.Tpo -c 
ascmagic.c  -fno-common -DPIC -o .libs/ascmagic.o
gcc -DHAVE_CONFIG_H -I. -I.. -DMAGIC=\"/usr/local/share/file/magic\" -Wall 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-Wmissing-declarations -Wredundant-decls -Wnested-externs -Wsign-compare 
-Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra 
-Wunused-parameter -g -O2 -MT ascmagic.lo -MD -MP -MF .deps/ascmagic.Tpo -c 
ascmagic.c -o ascmagic.o >/dev/null 2>&1
mv -f .deps/ascmagic.Tpo .deps/ascmagic.Plo
/bin/sh ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. 
-DMAGIC='"/usr/local/share/file/magic"'  -Wall -Wstrict-prototypes 
-Wmissing-prototypes -Wpointer-arith        -Wmissing-declarations 
-Wredundant-decls -Wnested-externs        -Wsign-compare -Wreturn-type 
-Wswitch -Wshadow        -Wcast-qual -Wwrite-strings -Wextra 
-Wunused-parameter -g -O2 -MT compress.lo -MD -MP -MF .deps/compress.Tpo -c 
-o compress.lo compress.c
gcc -DHAVE_CONFIG_H -I. -I.. -DMAGIC=\"/usr/local/share/file/magic\" -Wall 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-Wmissing-declarations -Wredundant-decls -Wnested-externs -Wsign-compare 
-Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra 
-Wunused-parameter -g -O2 -MT compress.lo -MD -MP -MF .deps/compress.Tpo -c 
compress.c  -fno-common -DPIC -o .libs/compress.o
gcc -DHAVE_CONFIG_H -I. -I.. -DMAGIC=\"/usr/local/share/file/magic\" -Wall 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-Wmissing-declarations -Wredundant-decls -Wnested-externs -Wsign-compare 
-Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra 
-Wunused-parameter -g -O2 -MT compress.lo -MD -MP -MF .deps/compress.Tpo -c 
compress.c -o compress.o >/dev/null 2>&1
mv -f .deps/compress.Tpo .deps/compress.Plo
/bin/sh ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. 
-DMAGIC='"/usr/local/share/file/magic"'  -Wall -Wstrict-prototypes 
-Wmissing-prototypes -Wpointer-arith        -Wmissing-declarations 
-Wredundant-decls -Wnested-externs        -Wsign-compare -Wreturn-type 
-Wswitch -Wshadow        -Wcast-qual -Wwrite-strings -Wextra 
-Wunused-parameter -g -O2 -MT is_tar.lo -MD -MP -MF .deps/is_tar.Tpo -c -o 
is_tar.lo is_tar.c
gcc -DHAVE_CONFIG_H -I. -I.. -DMAGIC=\"/usr/local/share/file/magic\" -Wall 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-Wmissing-declarations -Wredundant-decls -Wnested-externs -Wsign-compare 
-Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra 
-Wunused-parameter -g -O2 -MT is_tar.lo -MD -MP -MF .deps/is_tar.Tpo -c 
is_tar.c  -fno-common -DPIC -o .libs/is_tar.o
gcc -DHAVE_CONFIG_H -I. -I.. -DMAGIC=\"/usr/local/share/file/magic\" -Wall 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-Wmissing-declarations -Wredundant-decls -Wnested-externs -Wsign-compare 
-Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra 
-Wunused-parameter -g -O2 -MT is_tar.lo -MD -MP -MF .deps/is_tar.Tpo -c 
is_tar.c -o is_tar.o >/dev/null 2>&1
mv -f .deps/is_tar.Tpo .deps/is_tar.Plo
/bin/sh ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. 
-DMAGIC='"/usr/local/share/file/magic"'  -Wall -Wstrict-prototypes 
-Wmissing-prototypes -Wpointer-arith        -Wmissing-declarations 
-Wredundant-decls -Wnested-externs        -Wsign-compare -Wreturn-type 
-Wswitch -Wshadow        -Wcast-qual -Wwrite-strings -Wextra 
-Wunused-parameter -g -O2 -MT readelf.lo -MD -MP -MF .deps/readelf.Tpo -c -o 
readelf.lo readelf.c
gcc -DHAVE_CONFIG_H -I. -I.. -DMAGIC=\"/usr/local/share/file/magic\" -Wall 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-Wmissing-declarations -Wredundant-decls -Wnested-externs -Wsign-compare 
-Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra 
-Wunused-parameter -g -O2 -MT readelf.lo -MD -MP -MF .deps/readelf.Tpo -c 
readelf.c  -fno-common -DPIC -o .libs/readelf.o
gcc -DHAVE_CONFIG_H -I. -I.. -DMAGIC=\"/usr/local/share/file/magic\" -Wall 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-Wmissing-declarations -Wredundant-decls -Wnested-externs -Wsign-compare 
-Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra 
-Wunused-parameter -g -O2 -MT readelf.lo -MD -MP -MF .deps/readelf.Tpo -c 
readelf.c -o readelf.o >/dev/null 2>&1
mv -f .deps/readelf.Tpo .deps/readelf.Plo
/bin/sh ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. 
-DMAGIC='"/usr/local/share/file/magic"'  -Wall -Wstrict-prototypes 
-Wmissing-prototypes -Wpointer-arith        -Wmissing-declarations 
-Wredundant-decls -Wnested-externs        -Wsign-compare -Wreturn-type 
-Wswitch -Wshadow        -Wcast-qual -Wwrite-strings -Wextra 
-Wunused-parameter -g -O2 -MT print.lo -MD -MP -MF .deps/print.Tpo -c -o 
print.lo print.c
gcc -DHAVE_CONFIG_H -I. -I.. -DMAGIC=\"/usr/local/share/file/magic\" -Wall 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-Wmissing-declarations -Wredundant-decls -Wnested-externs -Wsign-compare 
-Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra 
-Wunused-parameter -g -O2 -MT print.lo -MD -MP -MF .deps/print.Tpo -c 
print.c  -fno-common -DPIC -o .libs/print.o
gcc -DHAVE_CONFIG_H -I. -I.. -DMAGIC=\"/usr/local/share/file/magic\" -Wall 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-Wmissing-declarations -Wredundant-decls -Wnested-externs -Wsign-compare 
-Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra 
-Wunused-parameter -g -O2 -MT print.lo -MD -MP -MF .deps/print.Tpo -c 
print.c -o print.o >/dev/null 2>&1
mv -f .deps/print.Tpo .deps/print.Plo
/bin/sh ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. 
-DMAGIC='"/usr/local/share/file/magic"'  -Wall -Wstrict-prototypes 
-Wmissing-prototypes -Wpointer-arith        -Wmissing-declarations 
-Wredundant-decls -Wnested-externs        -Wsign-compare -Wreturn-type 
-Wswitch -Wshadow        -Wcast-qual -Wwrite-strings -Wextra 
-Wunused-parameter -g -O2 -MT fsmagic.lo -MD -MP -MF .deps/fsmagic.Tpo -c -o 
fsmagic.lo fsmagic.c
gcc -DHAVE_CONFIG_H -I. -I.. -DMAGIC=\"/usr/local/share/file/magic\" -Wall 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-Wmissing-declarations -Wredundant-decls -Wnested-externs -Wsign-compare 
-Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra 
-Wunused-parameter -g -O2 -MT fsmagic.lo -MD -MP -MF .deps/fsmagic.Tpo -c 
fsmagic.c  -fno-common -DPIC -o .libs/fsmagic.o
gcc -DHAVE_CONFIG_H -I. -I.. -DMAGIC=\"/usr/local/share/file/magic\" -Wall 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-Wmissing-declarations -Wredundant-decls -Wnested-externs -Wsign-compare 
-Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra 
-Wunused-parameter -g -O2 -MT fsmagic.lo -MD -MP -MF .deps/fsmagic.Tpo -c 
fsmagic.c -o fsmagic.o >/dev/null 2>&1
mv -f .deps/fsmagic.Tpo .deps/fsmagic.Plo
/bin/sh ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. 
-DMAGIC='"/usr/local/share/file/magic"'  -Wall -Wstrict-prototypes 
-Wmissing-prototypes -Wpointer-arith        -Wmissing-declarations 
-Wredundant-decls -Wnested-externs        -Wsign-compare -Wreturn-type 
-Wswitch -Wshadow        -Wcast-qual -Wwrite-strings -Wextra 
-Wunused-parameter -g -O2 -MT funcs.lo -MD -MP -MF .deps/funcs.Tpo -c -o 
funcs.lo funcs.c
gcc -DHAVE_CONFIG_H -I. -I.. -DMAGIC=\"/usr/local/share/file/magic\" -Wall 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-Wmissing-declarations -Wredundant-decls -Wnested-externs -Wsign-compare 
-Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra 
-Wunused-parameter -g -O2 -MT funcs.lo -MD -MP -MF .deps/funcs.Tpo -c 
funcs.c  -fno-common -DPIC -o .libs/funcs.o
gcc -DHAVE_CONFIG_H -I. -I.. -DMAGIC=\"/usr/local/share/file/magic\" -Wall 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-Wmissing-declarations -Wredundant-decls -Wnested-externs -Wsign-compare 
-Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra 
-Wunused-parameter -g -O2 -MT funcs.lo -MD -MP -MF .deps/funcs.Tpo -c 
funcs.c -o funcs.o >/dev/null 2>&1
mv -f .deps/funcs.Tpo .deps/funcs.Plo
/bin/sh ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. 
-DMAGIC='"/usr/local/share/file/magic"'  -Wall -Wstrict-prototypes 
-Wmissing-prototypes -Wpointer-arith        -Wmissing-declarations 
-Wredundant-decls -Wnested-externs        -Wsign-compare -Wreturn-type 
-Wswitch -Wshadow        -Wcast-qual -Wwrite-strings -Wextra 
-Wunused-parameter -g -O2 -MT apptype.lo -MD -MP -MF .deps/apptype.Tpo -c -o 
apptype.lo apptype.c
gcc -DHAVE_CONFIG_H -I. -I.. -DMAGIC=\"/usr/local/share/file/magic\" -Wall 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-Wmissing-declarations -Wredundant-decls -Wnested-externs -Wsign-compare 
-Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra 
-Wunused-parameter -g -O2 -MT apptype.lo -MD -MP -MF .deps/apptype.Tpo -c 
apptype.c  -fno-common -DPIC -o .libs/apptype.o
gcc -DHAVE_CONFIG_H -I. -I.. -DMAGIC=\"/usr/local/share/file/magic\" -Wall 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-Wmissing-declarations -Wredundant-decls -Wnested-externs -Wsign-compare 
-Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra 
-Wunused-parameter -g -O2 -MT apptype.lo -MD -MP -MF .deps/apptype.Tpo -c 
apptype.c -o apptype.o >/dev/null 2>&1
mv -f .deps/apptype.Tpo .deps/apptype.Plo
/bin/sh ../libtool --tag=CC   --mode=link gcc -Wall -Wstrict-prototypes 
-Wmissing-prototypes -Wpointer-arith        -Wmissing-declarations 
-Wredundant-decls -Wnested-externs        -Wsign-compare -Wreturn-type 
-Wswitch -Wshadow        -Wcast-qual -Wwrite-strings -Wextra 
-Wunused-parameter -g -O2 -no-undefined -version-info 1:0:0  -o libmagic.la 
-rpath /usr/local/lib magic.lo apprentice.lo softmagic.lo ascmagic.lo 
compress.lo is_tar.lo readelf.lo print.lo fsmagic.lo funcs.lo apptype.lo  -lz
gcc -dynamiclib  -o .libs/libmagic.1.0.0.dylib  .libs/magic.o 
.libs/apprentice.o .libs/softmagic.o .libs/ascmagic.o .libs/compress.o 
.libs/is_tar.o .libs/readelf.o .libs/print.o .libs/fsmagic.o .libs/funcs.o 
.libs/apptype.o  -lz  -install_name  /usr/local/lib/libmagic.1.dylib 
-Wl,-compatibility_version -Wl,2 -Wl,-current_version -Wl,2.0
ld: duplicate symbol _li in .libs/apprentice.o and .libs/magic.o

collect2: ld returned 1 exit status
make[2]: *** [libmagic.la] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

The only debugging step I know:

macpro% nm src/.libs/apprentice.o | grep _li
0000cc40 S _li
macpro% nm src/.libs/magic.o | grep _li
000029f8 S _li

(NB: this symbol does not appear in either .o on my Fedora machine, although 
"li" (no underscore) appears in both, as a [C]ommon symbol)


More information about the macports-dev mailing list