On 03/03/18 22:06, matthew green wrote: > we occasionally have to deal with this and either link against > libgcc or provide them in libkern/libsa. there can be new > things from newer compilers, etc., when it starts emitting > new calls it expects in libgcc or other. kernels should not > be using libgcc.
Got it. >>> i don't know you can easily test it. i would recommend >>> putting the old code back for ${HAVE_GCC:U0} > 0 builds. >> >> Like so? > > the patch below needs to remove the original line :-) > > i'd probably implment it with eg > > EXTRA_OBJS= > .if ${HAVE_GCC:U0} > 0 > EXTRA_OBJS+= ${DESTDIR}/usr/lib/libgcc.a > .endif > > and add ${EXTRA_OBJS} to the link line, instead of duplicating > the line inside the .if. Thanks for the pointer, I appreciate it. One thing though, either I'm missing something really obvious or that doesn't work (/usr/lib/libgcc.a is not passed to the linker). This does Index: sys/arch/macppc/stand/bootxx/Makefile =================================================================== RCS file: /cvsroot/src/sys/arch/macppc/stand/bootxx/Makefile,v retrieving revision 1.18 diff -u -p -r1.18 Makefile --- sys/arch/macppc/stand/bootxx/Makefile 2 Mar 2018 23:15:25 -0000 1.18 +++ sys/arch/macppc/stand/bootxx/Makefile 4 Mar 2018 04:18:41 -0000 @@ -20,10 +20,11 @@ STRIPFLAG= LINKFLAGS= -x -N -Ttext 4000 -e _start LINKFLAGS+= ${LINKFLAGS_UNWIND} CLEANFILES+= ${PROG}.sym +EXTRA_OBJS= ${${HAVE_GCC:U0} > 0 :? ${DESTDIR}/usr/lib/libgcc.a :} ${PROG}: ${OBJS} ${_MKTARGET_LINK} - ${LD} -o ${.TARGET}.sym ${LINKFLAGS} ${OBJS} + ${LD} -o ${.TARGET}.sym ${LINKFLAGS} ${OBJS} ${EXTRA_OBJS} ${OBJCOPY} -O binary ${.TARGET}.sym ${.TARGET} .include <bsd.klinks.mk> Sevan