Add -mno-relax to CFLAGS in bsd.prog/lib.mk instead of bsd.cpu.mk.
bsd.cpu.mk is included by bsd.init.mk before bsd.linker.mk, so it was always setting the flag since LINKER_FEATURES wasn't defined. Reported by: mhorne Reviewed by: imp, mhorne Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D23076
This commit is contained in:
parent
c6e310323f
commit
25ff968a90
@ -375,10 +375,6 @@ CFLAGS += -march=rv64imac -mabi=lp64
|
||||
.else
|
||||
CFLAGS += -march=rv64imafdc -mabi=lp64d
|
||||
.endif
|
||||
|
||||
.if ${LINKER_FEATURES:U:Mriscv-relaxations} == ""
|
||||
CFLAGS += -mno-relax
|
||||
.endif
|
||||
.endif
|
||||
|
||||
# NB: COPTFLAGS is handled in /usr/src/sys/conf/kern.pre.mk
|
||||
|
@ -98,6 +98,10 @@ STATIC_CFLAGS+= -ftls-model=initial-exec
|
||||
STATIC_CXXFLAGS+= -ftls-model=initial-exec
|
||||
.endif
|
||||
|
||||
.if ${MACHINE_CPUARCH} == "riscv" && ${LINKER_FEATURES:Mriscv-relaxations} == ""
|
||||
CFLAGS += -mno-relax
|
||||
.endif
|
||||
|
||||
.include <bsd.libnames.mk>
|
||||
|
||||
# prefer .s to a .c, add .po, remove stuff not used in the BSD libraries
|
||||
|
@ -57,6 +57,10 @@ LDFLAGS+= -Wl,-zretpolineplt
|
||||
.endif
|
||||
.endif
|
||||
|
||||
.if ${MACHINE_CPUARCH} == "riscv" && ${LINKER_FEATURES:Mriscv-relaxations} == ""
|
||||
CFLAGS += -mno-relax
|
||||
.endif
|
||||
|
||||
.if defined(CRUNCH_CFLAGS)
|
||||
CFLAGS+=${CRUNCH_CFLAGS}
|
||||
.else
|
||||
|
Loading…
x
Reference in New Issue
Block a user