diff options
author | dim <dim@FreeBSD.org> | 2012-04-20 21:00:39 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-04-20 21:00:39 +0000 |
commit | 3b2aa532bfa1474da589bfe1baf5a749a9b53a20 (patch) | |
tree | f9d405ea3966d37676f2be35a198a12a1b3dd92a /lib/csu | |
parent | 000bbf07daf300341bc3a642e10cf636932d4fcf (diff) | |
download | FreeBSD-src-3b2aa532bfa1474da589bfe1baf5a749a9b53a20.zip FreeBSD-src-3b2aa532bfa1474da589bfe1baf5a749a9b53a20.tar.gz |
After r217375, some startup objects under lib/csu are built in a special
way: first they are compiled to assembly, then some sed'ing is done on
the assembly, and lastly the assembly is compiled to an object file.
This last step is done using ${CC}, and not ${AS}, because when the
compiler is clang, it outputs directives that are too advanced for our
old gas. So we use clang's integrated assembler instead. (When the
compiler is gcc, it just calls gas, and nothing is different, except one
extra fork.)
However, in the .s to .o rules in lib/csu/$ARCH/Makefile, I still passed
CFLAGS to the compiler, instead of ACFLAGS, which are specifically for
compiling .s files.
In case you are using '-g' for debug info anywhere in your CFLAGS, it
causes the .s files to already contain debug information in the assembly
itself. In the next step, the .s files are also compiled using '-g',
and if the compiler is clang, it complains: "error: input can't have
.file dwarf directives when -g is used to generate dwarf debug info for
assembly code".
Fix this by using ${ACFLAGS} for compiling the .s files instead.
Reported by: jasone
MFC after: 1 week
Diffstat (limited to 'lib/csu')
-rw-r--r-- | lib/csu/amd64/Makefile | 6 | ||||
-rw-r--r-- | lib/csu/arm/Makefile | 6 | ||||
-rw-r--r-- | lib/csu/i386-elf/Makefile | 6 | ||||
-rw-r--r-- | lib/csu/ia64/Makefile | 6 | ||||
-rw-r--r-- | lib/csu/mips/Makefile | 6 | ||||
-rw-r--r-- | lib/csu/powerpc/Makefile | 6 | ||||
-rw-r--r-- | lib/csu/powerpc64/Makefile | 6 |
7 files changed, 21 insertions, 21 deletions
diff --git a/lib/csu/amd64/Makefile b/lib/csu/amd64/Makefile index b4a60a1..80d14a7 100644 --- a/lib/csu/amd64/Makefile +++ b/lib/csu/amd64/Makefile @@ -22,21 +22,21 @@ crt1.s: crt1.c sed ${SED_FIX_NOTE} ${.TARGET} crt1.o: crt1.s - ${CC} ${CFLAGS} -c -o ${.TARGET} crt1.s + ${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s gcrt1.s: crt1.c ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c sed ${SED_FIX_NOTE} ${.TARGET} gcrt1.o: gcrt1.s - ${CC} ${CFLAGS} -c -o ${.TARGET} gcrt1.s + ${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s Scrt1.s: crt1.c ${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c sed ${SED_FIX_NOTE} ${.TARGET} Scrt1.o: Scrt1.s - ${CC} ${CFLAGS} -c -o ${.TARGET} Scrt1.s + ${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s realinstall: ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ diff --git a/lib/csu/arm/Makefile b/lib/csu/arm/Makefile index 1e1d1fa..bf4c7b1 100644 --- a/lib/csu/arm/Makefile +++ b/lib/csu/arm/Makefile @@ -21,21 +21,21 @@ crt1.s: crt1.c sed ${SED_FIX_NOTE} ${.TARGET} crt1.o: crt1.s - ${CC} ${CFLAGS} -c -o ${.TARGET} crt1.s + ${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s gcrt1.s: crt1.c ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c sed ${SED_FIX_NOTE} ${.TARGET} gcrt1.o: gcrt1.s - ${CC} ${CFLAGS} -c -o ${.TARGET} gcrt1.s + ${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s Scrt1.s: crt1.c ${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c sed ${SED_FIX_NOTE} ${.TARGET} Scrt1.o: Scrt1.s - ${CC} ${CFLAGS} -c -o ${.TARGET} Scrt1.s + ${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s realinstall: ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ diff --git a/lib/csu/i386-elf/Makefile b/lib/csu/i386-elf/Makefile index aef9a5c..286c15c 100644 --- a/lib/csu/i386-elf/Makefile +++ b/lib/csu/i386-elf/Makefile @@ -21,7 +21,7 @@ gcrt1_c.s: crt1_c.c sed ${SED_FIX_NOTE} ${.TARGET} gcrt1_c.o: gcrt1_c.s - ${CC} ${CFLAGS} -c -o ${.TARGET} gcrt1_c.s + ${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1_c.s gcrt1.o: gcrt1_c.o crt1_s.o ${LD} ${LDFLAGS} -o gcrt1.o -r crt1_s.o gcrt1_c.o @@ -31,7 +31,7 @@ crt1_c.s: crt1_c.c sed ${SED_FIX_NOTE} ${.TARGET} crt1_c.o: crt1_c.s - ${CC} ${CFLAGS} -c -o ${.TARGET} crt1_c.s + ${CC} ${ACFLAGS} -c -o ${.TARGET} crt1_c.s crt1.o: crt1_c.o crt1_s.o ${LD} ${LDFLAGS} -o crt1.o -r crt1_s.o crt1_c.o @@ -42,7 +42,7 @@ Scrt1_c.s: crt1_c.c sed ${SED_FIX_NOTE} ${.TARGET} Scrt1_c.o: Scrt1_c.s - ${CC} ${CFLAGS} -c -o ${.TARGET} Scrt1_c.s + ${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1_c.s Scrt1.o: Scrt1_c.o crt1_s.o ${LD} ${LDFLAGS} -o Scrt1.o -r crt1_s.o Scrt1_c.o diff --git a/lib/csu/ia64/Makefile b/lib/csu/ia64/Makefile index 41d2b9c..b12e888 100644 --- a/lib/csu/ia64/Makefile +++ b/lib/csu/ia64/Makefile @@ -24,7 +24,7 @@ crtbrand.s: crtbrand.c sed -i "" -e '/\.note\.ABI-tag/s/progbits/note/' ${.TARGET} crtbrand.o: crtbrand.s - ${CC} ${CFLAGS} -c -o ${.TARGET} crtbrand.s + ${CC} ${ACFLAGS} -c -o ${.TARGET} crtbrand.s crt1.o: crt1_.o crtbrand.o ${LD} ${LDFLAGS} -r -o ${.TARGET} crt1_.o crtbrand.o @@ -37,7 +37,7 @@ gcrtbrand.s: crtbrand.c sed -i "" -e '/\.note\.ABI-tag/s/progbits/note/' ${.TARGET} gcrtbrand.o: gcrtbrand.s - ${CC} ${CFLAGS} -c -o ${.TARGET} gcrtbrand.s + ${CC} ${ACFLAGS} -c -o ${.TARGET} gcrtbrand.s gcrt1.o: gcrt1_.o gcrtbrand.o ${LD} ${LDFLAGS} -r -o ${.TARGET} ${.ALLSRC} @@ -50,7 +50,7 @@ Scrtbrand.s: crtbrand.c sed -i "" -e '/\.note\.ABI-tag/s/progbits/note/' ${.TARGET} Scrtbrand.o: Scrtbrand.s - ${CC} ${CFLAGS} -c -o ${.TARGET} Scrtbrand.s + ${CC} ${ACFLAGS} -c -o ${.TARGET} Scrtbrand.s Scrt1.o: Scrt1_.o Scrtbrand.o ${LD} ${LDFLAGS} -r -o ${.TARGET} ${.ALLSRC} diff --git a/lib/csu/mips/Makefile b/lib/csu/mips/Makefile index 1e1d1fa..bf4c7b1 100644 --- a/lib/csu/mips/Makefile +++ b/lib/csu/mips/Makefile @@ -21,21 +21,21 @@ crt1.s: crt1.c sed ${SED_FIX_NOTE} ${.TARGET} crt1.o: crt1.s - ${CC} ${CFLAGS} -c -o ${.TARGET} crt1.s + ${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s gcrt1.s: crt1.c ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c sed ${SED_FIX_NOTE} ${.TARGET} gcrt1.o: gcrt1.s - ${CC} ${CFLAGS} -c -o ${.TARGET} gcrt1.s + ${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s Scrt1.s: crt1.c ${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c sed ${SED_FIX_NOTE} ${.TARGET} Scrt1.o: Scrt1.s - ${CC} ${CFLAGS} -c -o ${.TARGET} Scrt1.s + ${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s realinstall: ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ diff --git a/lib/csu/powerpc/Makefile b/lib/csu/powerpc/Makefile index a3e0cab..123391e 100644 --- a/lib/csu/powerpc/Makefile +++ b/lib/csu/powerpc/Makefile @@ -22,21 +22,21 @@ crt1.s: crt1.c sed ${SED_FIX_NOTE} ${.TARGET} crt1.o: crt1.s - ${CC} ${CFLAGS} -c -o ${.TARGET} crt1.s + ${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s gcrt1.s: crt1.c ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c sed ${SED_FIX_NOTE} ${.TARGET} gcrt1.o: gcrt1.s - ${CC} ${CFLAGS} -c -o ${.TARGET} gcrt1.s + ${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s Scrt1.s: crt1.c ${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c sed ${SED_FIX_NOTE} ${.TARGET} Scrt1.o: Scrt1.s - ${CC} ${CFLAGS} -c -o ${.TARGET} Scrt1.s + ${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s realinstall: ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ diff --git a/lib/csu/powerpc64/Makefile b/lib/csu/powerpc64/Makefile index a3e0cab..123391e 100644 --- a/lib/csu/powerpc64/Makefile +++ b/lib/csu/powerpc64/Makefile @@ -22,21 +22,21 @@ crt1.s: crt1.c sed ${SED_FIX_NOTE} ${.TARGET} crt1.o: crt1.s - ${CC} ${CFLAGS} -c -o ${.TARGET} crt1.s + ${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s gcrt1.s: crt1.c ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c sed ${SED_FIX_NOTE} ${.TARGET} gcrt1.o: gcrt1.s - ${CC} ${CFLAGS} -c -o ${.TARGET} gcrt1.s + ${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s Scrt1.s: crt1.c ${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c sed ${SED_FIX_NOTE} ${.TARGET} Scrt1.o: Scrt1.s - ${CC} ${CFLAGS} -c -o ${.TARGET} Scrt1.s + ${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s realinstall: ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ |