From: zrj Date: Wed, 12 Oct 2016 13:49:13 +0000 (+0300) Subject: libstand: Add -fno-builtin in case of -flto. X-Git-Tag: v4.8.0rc~725 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/798dce1536d46acf187b11b8f7cdb1236f33ffa7 libstand: Add -fno-builtin in case of -flto. Not strictly needed but will help a lot during devel. No functional change for normal compilation. --- diff --git a/lib/libstand/Makefile b/lib/libstand/Makefile index 9a5e3d4fd6..9ff11a54dd 100644 --- a/lib/libstand/Makefile +++ b/lib/libstand/Makefile @@ -22,6 +22,10 @@ LIBSTAND_ARCH?= ${MACHINE_ARCH} # Mostly OK, some of the libc imports are a bit noisy CFLAGS+= -ffreestanding +.if (${CFLAGS:M-flto} && ${CCVER:Mgcc*}) +CFLAGS+= -fno-builtin # LTO exposes too much stuff +.endif + .if ${LIBSTAND_ARCH} == "x86_64" CFLAGS+= -mno-red-zone -fPIC .endif @@ -53,6 +57,10 @@ SRCS+= bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \ memcpy.c memmove.c memset.c qdivrem.c rindex.c strcat.c strchr.c \ strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c \ strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c + +# math stuff, thus no -flto! +qdivrem.o: qdivrem.c + ${CC} ${CFLAGS:N-flto} -c -o ${.TARGET} ${.IMPSRC} .endif .PATH: ${LIBSTAND_SRC}/../../sys/libkern SRCS+= icrc32.c