bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/15728] New: binutils fails to build with clang and --enabl


From: andrew at neitsch dot ca
Subject: [Bug binutils/15728] New: binutils fails to build with clang and --enable-targets=all on Mac OS
Date: Wed, 10 Jul 2013 21:15:50 +0000

http://sourceware.org/bugzilla/show_bug.cgi?id=15728

            Bug ID: 15728
           Summary: binutils fails to build with clang and
                    --enable-targets=all on Mac OS
           Product: binutils
           Version: 2.24 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: andrew at neitsch dot ca

On Mac OS, when using the clang compiler and --enable-targets=all, the build
fails with this error message:

/bin/sh ./libtool --tag=CC   --mode=link clang -W -Wall -Wstrict-prototypes
-Wmissing-prototypes -Wshadow -g -O2   -o dlltool dlltool.o defparse.o deflex.o
bucomm.o version.o filemode.o ../bfd/libbfd.la ../libiberty/libiberty.a -ll
./../intl/libintl.a -liconv -lz 
duplicate symbol _SUBWORDSIQI in:
    ../opcodes/.libs/libopcodes.a(m32c-dis.o)
    ../opcodes/.libs/libopcodes.a(m32c-asm.o)
    ...
duplicate symbol _SUBWORDDISI in:
    ../opcodes/.libs/libopcodes.a(m32c-dis.o)
    ../opcodes/.libs/libopcodes.a(m32c-opc.o)
/bin/sh ./libtool --tag=CC   --mode=link clang -W -Wall -Wstrict-prototypes
-Wmissing-prototypes -Wshadow -g -O2   -o windres windres.o resrc.o rescoff.o
resbin.o rcparse.o rclex.o winduni.o resres.o bucomm.o version.o filemode.o
../bfd/libbfd.la ../libiberty/libiberty.a -ll ./../intl/libintl.a -liconv
-liconv -lz 
ld: 20 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [objdump] Error 1

The problem seems to be that include/cgen/basic-ops.h [1] defines a number of
functions in the header file, which clang exports into the symbol table of the
object files, causing the link to fail due to duplicate symbols.

The below patch adds the static keyword to the problematic definitions.

[1]
http://sourceware.org/cgi-bin/cvsweb.cgi/src/include/cgen/basic-ops.h?rev=1.1&content-type=text/x-cvsweb-markup&cvsroot=src

--- a/include/cgen/basic-ops.h    2009-10-23 18:17:08.000000000 -0600
+++ b/include/cgen/basic-ops.h    2013-07-10 14:21:44.000000000 -0600
@@ -295,11 +295,11 @@
    significant and word number 0 is the most significant word.
    ??? May also wish an endian-dependent version.  Later.  */

-QI SUBWORDSIQI (SI, int);
-HI SUBWORDSIHI (SI, int);
-QI SUBWORDDIQI (DI, int);
-HI SUBWORDDIHI (DI, int);
-SI SUBWORDDISI (DI, int);
+static QI SUBWORDSIQI (SI, int);
+static HI SUBWORDSIHI (SI, int);
+static QI SUBWORDDIQI (DI, int);
+static HI SUBWORDDIHI (DI, int);
+static SI SUBWORDDISI (DI, int);

 #ifdef SEMOPS_DEFINE_INLINE

-- 
You are receiving this mail because:
You are on the CC list for the bug.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]