Changeset View
Standalone View
share/mk/bsd.cpu.mk
Show First 20 Lines • Show All 310 Lines • ▼ Show 20 Lines | |||||
CFLAGS += -EL | CFLAGS += -EL | ||||
LDFLAGS += -EL | LDFLAGS += -EL | ||||
. else | . else | ||||
ACFLAGS += -EB | ACFLAGS += -EB | ||||
AFLAGS += -EB | AFLAGS += -EB | ||||
CFLAGS += -EB | CFLAGS += -EB | ||||
LDFLAGS += -EB | LDFLAGS += -EB | ||||
. endif | . endif | ||||
. if ${MACHINE_ARCH:Mmips64*} != "" | |||||
ACFLAGS+= -mabi=64 | |||||
AFLAGS+= -mabi=64 | |||||
CFLAGS+= -mabi=64 | |||||
LDFLAGS+= -mabi=64 | |||||
. elif ${MACHINE_ARCH:Mmipsn32*} != "" | |||||
ACFLAGS+= -mabi=n32 | |||||
AFLAGS+= -mabi=n32 | |||||
CFLAGS+= -mabi=n32 | |||||
LDFLAGS+= -mabi=n32 | |||||
. else | |||||
ACFLAGS+= -mabi=32 | |||||
AFLAGS+= -mabi=32 | |||||
CFLAGS+= -mabi=32 | |||||
LDFLAGS+= -mabi=32 | |||||
. endif | |||||
emaste: Might be worth factoring out the -EL/-EB/-mabi into MIPS_FLAGS or something rather than… | |||||
impUnsubmitted Not Done Inline ActionsAt one point I used _CPUFLAGS for this. Bit I had also eliminated NO_CPU_CFLAGS as well... Do all these flags need to be set? ACFLAGS is set from cflags, so wouldn't that be duplicative, for example? We used to require that the ABI of the compiler match the target so things like ports would just work on the target system. There's a risk that the system compiler won't produce the right binaries now, but I think time has shown that's a less severe problem than issues we have because we don't specify everything. imp: At one point I used _CPUFLAGS for this. Bit I had also eliminated NO_CPU_CFLAGS as well...
Do… | |||||
jhbAuthorUnsubmitted Not Done Inline ActionsHmm, ACFLAGS does not appear to be set from CFLAGS. In sys.mk: AS ?= as AFLAGS ?= ACFLAGS ?= I had originally only set these for buildworld/buildkernel in Makefile.inc1 btw, but kan@'s changes in rS308711 are what led me to move them here to be beside the -EL/-EB. I'm fine doing a _MIPS_FLAGS if we agree that is cleaner. jhb: Hmm, ACFLAGS does not appear to be set from CFLAGS. In sys.mk:
```
AS ?= as… | |||||
impUnsubmitted Not Done Inline ActionsLook at bsd.suffixes.mk (and others): .S.o: ${CC:N${CCACHE_BIN}} ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} So ACFLAGS is additional flags for assembler not contained in CFLAGS.... kan's changes were wrong as well... imp: Look at bsd.suffixes.mk (and others):
.S.o:
${CC:N${CCACHE_BIN}} ${CFLAGS} ${ACFLAGS}… | |||||
jhbAuthorUnsubmitted Not Done Inline ActionsSo this breaks lib/csu/mips/Makefile which uses: crt1.s: crt1.c ${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1.c sed ${SED_FIX_NOTE} ${.TARGET} crt1.o: crt1.s ${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s And apparently that _can't_ use CFLAGS directly but has to only use ACFLAGS per rS234502. jhb: So this breaks lib/csu/mips/Makefile which uses:
```
crt1.s: crt1.c
${CC} ${CFLAGS} -S… | |||||
impUnsubmitted Not Done Inline ActionsYea, that usage is wrong, but sadly necessary. imp: Yea, that usage is wrong, but sadly necessary. | |||||
. if ${MACHINE_ARCH:Mmips*hf} | . if ${MACHINE_ARCH:Mmips*hf} | ||||
CFLAGS += -mhard-float | CFLAGS += -mhard-float | ||||
. else | . else | ||||
CFLAGS += -msoft-float | CFLAGS += -msoft-float | ||||
. endif | . endif | ||||
.endif | .endif | ||||
########## arm | ########## arm | ||||
Show All 22 Lines | |||||
.if ${MACHINE_ARCH} == "powerpcspe" | .if ${MACHINE_ARCH} == "powerpcspe" | ||||
CFLAGS += -mcpu=8540 -Wa,-me500 -mspe=yes -mabi=spe -mfloat-gprs=double | CFLAGS += -mcpu=8540 -Wa,-me500 -mspe=yes -mabi=spe -mfloat-gprs=double | ||||
.endif | .endif | ||||
.if ${MACHINE_CPUARCH} == "riscv" | .if ${MACHINE_CPUARCH} == "riscv" | ||||
.if ${TARGET_ARCH:Mriscv*sf} | .if ${TARGET_ARCH:Mriscv*sf} | ||||
CFLAGS += -mno-float | CFLAGS += -mno-float | ||||
ACFLAGS += -mno-float | ACFLAGS += -mno-float | ||||
Not Done Inline ActionsThis is likely due to the same csu Makefile issues and should probably be removed eventually as well. jhb: This is likely due to the same csu Makefile issues and should probably be removed eventually as… | |||||
.endif | .endif | ||||
.endif | .endif | ||||
# NB: COPTFLAGS is handled in /usr/src/sys/conf/kern.pre.mk | # NB: COPTFLAGS is handled in /usr/src/sys/conf/kern.pre.mk | ||||
.if !defined(NO_CPU_CFLAGS) | .if !defined(NO_CPU_CFLAGS) | ||||
CFLAGS += ${_CPUCFLAGS} | CFLAGS += ${_CPUCFLAGS} | ||||
ACFLAGS += ${_CPUCFLAGS} | |||||
jhbAuthorUnsubmitted Not Done Inline ActionsThis is required for external GCC to compile assembly files that use ll/sc since external GCC requires an explicit CPUTYPE for o32 (it's default -march= for o32 is mips2) jhb: This is required for external GCC to compile assembly files that use ll/sc since external GCC… | |||||
jhbAuthorUnsubmitted Not Done Inline ActionsActually, this is the same issue as above for lib/csu/<foo>/Makefile. jhb: Actually, this is the same issue as above for lib/csu/<foo>/Makefile. | |||||
.endif | .endif | ||||
# | # | ||||
# Prohibit the compiler from emitting SIMD instructions. | # Prohibit the compiler from emitting SIMD instructions. | ||||
# These flags are added to CFLAGS in areas where the extra context-switch | # These flags are added to CFLAGS in areas where the extra context-switch | ||||
# cost outweighs the advantages of SIMD instructions. | # cost outweighs the advantages of SIMD instructions. | ||||
# | # | ||||
# gcc: | # gcc: | ||||
Show All 19 Lines |
Might be worth factoring out the -EL/-EB/-mabi into MIPS_FLAGS or something rather than repeating groups of ACFLAGS/AFLAGS/CFLAGS/LDFLAGS n times?