tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: LLVM build warnings

On Sat, Apr 11, 2020 at 01:05:07PM +0200, Maxime Villard wrote:
> [I'm not subscribed to this list, so if you want to answer, make sure to CC me]
> When testing CFLAGS with LLVM, I often hit warnings like this one:
> 	--- libkern.o ---
> 	building standard kern library
> 	aarch64--netbsd-clang: error: argument unused during compilation: 'XXX' [-Werror,-Wunused-command-line-argument]

Well, use the appropiate variable and not CFLAGS then.

> This is annoying, and each time I have to apply this change to make it compile:
> 	--- share/mk/
> 	+++ share/mk/
> 	@@ -568,7 +568,7 @@ __archivesymlinkpic: .USE
> 	 __buildstdlib: .USE
> 		@echo building standard ${.TARGET:T:S/.o//:S/lib//} library
> 		@rm -f ${.TARGET}
> 	-       @${LINK.c:S/-nostdinc//} -nostdlib ${LDFLAGS} -r -o ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}`
> 	+       @${LINK.c:S/-nostdinc//} -nostdlib ${LDFLAGS} -Wno-unused-command-line-argument -r -o ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}`
> 	 .endif
> 	 .if !target(__buildproflib)
> There is already the "S/-nostdinc//" that drops one CFLAG to avoid the warning
> with it, but the number of CFLAGS to list there can quickly grow, and I think
> that it is better to disable the warning completely.
> I'll commit that soon, feel free to improve afterwards if you have better
> ideas.

No, please don't commit that. It's definitely not necessary.


Home | Main Index | Thread Index | Old Index