ACFLAGS is only used in addition to CFLAGS, so setting the options
in both was redundant. However, ACFLAGS is added to the command
line after CFLAGS, so the settings from ACFLAGS were applied for
assembly files in kernel modules after the kernel-specific march/abi
in CFLAGS. As a result, the hard-float ACFLAGS in bsd.cpu.mk was
overriding the soft-float CFLAGS.gcc in sys/conf/kern.mk. In particular,
dtrace_asm.o was compiled as hard-float and the linker refused to link
dtrace.ko since its object files contained a mix of hard and soft float.
Details
- Reviewers
br - Commits
- rS335892: Don't specify the desired march/mabi for RISC-V in ACFLAGS.
- compile RISCV GENERIC kernel with updated binutils (2.30)
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Actually, I wonder if ACFLAGS shouldn't be removed from bsd.cpu.mk instead. ACFLAGS is always included in addition CFLAGS, so the settings in ACFLAGS are redundant with CFLAGS in bsd.cpu.mk. (There is a separate AFLAGS for flags passed to a standalone assembler. Perhaps the ACFLAGS in bsd.cpu.mk was supposed to be AFLAGS instead?)
I've reworked this change to just remove ACFLAGS instead. No other platforms set anything in ACFLAGS in bsd.cpu.mk so I think this is more consistent. We could perhaps set AFLAGS, but I don't think anything uses AFLAGS in the tree, so I'd rather wait to add that until a real need arises.
Also, this failure was reported on the current riscv64-binutils as well, so this isn't a new breakage exposed by the binutils upgrade to 2.30.