Changeset View
Standalone View
lib/csu/i386/Makefile
Show All 25 Lines | |||||
gcrt1_c.s: crt1_c.c | gcrt1_c.s: crt1_c.c | ||||
${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1_c.c | ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1_c.c | ||||
sed ${SED_FIX_NOTE} ${.TARGET} | sed ${SED_FIX_NOTE} ${.TARGET} | ||||
gcrt1_c.o: gcrt1_c.s | gcrt1_c.o: gcrt1_c.s | ||||
${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} gcrt1_c.s | ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} gcrt1_c.s | ||||
gcrt1.o: gcrt1_c.o crt1_s.o | gcrt1.o: gcrt1_c.o crt1_s.o | ||||
${LD} ${_LDFLAGS} -o gcrt1.o -r crt1_s.o gcrt1_c.o | ${LD} ${_LDFLAGS:N--gdb-index} -o gcrt1.o -r crt1_s.o gcrt1_c.o | ||||
emaste: IMO these `:N` changes can be committed separately now for anyone who might want to experiment… | |||||
jhbAuthorUnsubmitted Done Inline ActionsIt's kind of gross to have to do them all over the place. I wish there was a way to make them less gross, but I don't have a better idea. We could maybe have _LDRFLAGS and LDRFLAGS for use with LD -r? That only seems slightly better. jhb: It's kind of gross to have to do them all over the place. I wish there was a way to make them… | |||||
bdreweryUnsubmitted Not Done Inline ActionsOr a function for compiling and linking would be nice. LDRFLAGS+= --gdb-index ... _LDFLAGSFILT= ${_LDFLAGS:${LDRFLAGS:S,^,N,:ts:}} ` Then you can use ${_LDFLAGSFILT} I don't know offhand why some of these are LDFLAGS and others are _LDFLAGS. bdrewery: Or a function for compiling and linking would be nice.
```
LDRFLAGS+= --gdb-index
... | |||||
jhbAuthorUnsubmitted Done Inline ActionsLDFLAGS is for use with CC (so has -Wl, prefixes, or CC-specific flags like -fuse-ld or -mabi for mips) whereas _LDFLAGS is for direct invocations of LD. In this case, you still would only want to apply the filter for LD invocations that use -r (not all do). Perhaps just having a single _LDRFLAGSFILT would be ok though. Could just assign to it directly. jhb: `LDFLAGS` is for use with `CC` (so has `-Wl,` prefixes, or CC-specific flags like `-fuse-ld` or… | |||||
arichardsonUnsubmitted Not Done Inline ActionsI guess we could also filter --gdb-index from _LDFLAGS? I think most direct linker invocations are for ld -r or the kernel? arichardson: I guess we could also filter --gdb-index from _LDFLAGS? I think most direct linker invocations… | |||||
crt1_c.s: crt1_c.c | crt1_c.s: crt1_c.c | ||||
${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1_c.c | ${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1_c.c | ||||
sed ${SED_FIX_NOTE} ${.TARGET} | sed ${SED_FIX_NOTE} ${.TARGET} | ||||
crt1_c.o: crt1_c.s | crt1_c.o: crt1_c.s | ||||
${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} crt1_c.s | ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} crt1_c.s | ||||
crt1.o: crt1_c.o crt1_s.o | crt1.o: crt1_c.o crt1_s.o | ||||
${LD} ${_LDFLAGS} -o crt1.o -r crt1_s.o crt1_c.o | ${LD} ${_LDFLAGS:N--gdb-index} -o crt1.o -r crt1_s.o crt1_c.o | ||||
${OBJCOPY} --localize-symbol _start1 crt1.o | ${OBJCOPY} --localize-symbol _start1 crt1.o | ||||
Scrt1_c.s: crt1_c.c | Scrt1_c.s: crt1_c.c | ||||
${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1_c.c | ${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1_c.c | ||||
sed ${SED_FIX_NOTE} ${.TARGET} | sed ${SED_FIX_NOTE} ${.TARGET} | ||||
Scrt1_c.o: Scrt1_c.s | Scrt1_c.o: Scrt1_c.s | ||||
${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} Scrt1_c.s | ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} Scrt1_c.s | ||||
Scrt1.o: Scrt1_c.o crt1_s.o | Scrt1.o: Scrt1_c.o crt1_s.o | ||||
${LD} ${_LDFLAGS} -o Scrt1.o -r crt1_s.o Scrt1_c.o | ${LD} ${_LDFLAGS:N--gdb-index} -o Scrt1.o -r crt1_s.o Scrt1_c.o | ||||
${OBJCOPY} --localize-symbol _start1 Scrt1.o | ${OBJCOPY} --localize-symbol _start1 Scrt1.o | ||||
.include <bsd.lib.mk> | .include <bsd.lib.mk> |
IMO these :N changes can be committed separately now for anyone who might want to experiment with adding --gdb-index to LDFLAGS.