Connect new LLVM-based libgcc_eh & libgcc_s to the build

Compiler-rt and LLVM's libunwind provide a suitable replacement for
libgcc.a, libgcc_eh.a, and libgcc_s.so.

Remove the now-unused LLVM_LIBUNWIND block from gnu/lib/libgcc.

PR:		213480 [exp-run]
Reviewed by:	brooks, ed
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D8189
This commit is contained in:
Ed Maste 2016-11-04 19:35:49 +00:00
parent 73e62e8c5c
commit c7fbd7722d
4 changed files with 23 additions and 43 deletions

View File

@ -2001,7 +2001,7 @@ libraries: .MAKE .PHONY
# #
# static libgcc.a prerequisite for shared libc # static libgcc.a prerequisite for shared libc
# #
_prereq_libs= gnu/lib/libgcc lib/libcompiler_rt _prereq_libs= lib/libcompiler_rt
.if ${MK_SSP} != "no" .if ${MK_SSP} != "no"
_prereq_libs+= gnu/lib/libssp/libssp_nonshared _prereq_libs+= gnu/lib/libssp/libssp_nonshared
.endif .endif
@ -2013,7 +2013,6 @@ _prereq_libs+= gnu/lib/libssp/libssp_nonshared
# #
_startup_libs= gnu/lib/csu _startup_libs= gnu/lib/csu
_startup_libs+= lib/csu _startup_libs+= lib/csu
_startup_libs+= gnu/lib/libgcc
_startup_libs+= lib/libcompiler_rt _startup_libs+= lib/libcompiler_rt
_startup_libs+= lib/libc _startup_libs+= lib/libc
_startup_libs+= lib/libc_nonshared _startup_libs+= lib/libc_nonshared
@ -2021,11 +2020,27 @@ _startup_libs+= lib/libc_nonshared
_startup_libs+= lib/libcxxrt _startup_libs+= lib/libcxxrt
.endif .endif
.if ${MK_LLVM_LIBUNWIND} != "no"
_prereq_libs+= lib/libgcc_eh lib/libgcc_s
_startup_libs+= lib/libgcc_eh lib/libgcc_s
lib/libgcc_s__L: lib/libc__L
lib/libgcc_s__L: lib/libc_nonshared__L
.if ${MK_LIBCPLUSPLUS} != "no"
lib/libcxxrt__L: lib/libgcc_s__L
.endif
.else # MK_LLVM_LIBUNWIND == no
_prereq_libs+= gnu/lib/libgcc
_startup_libs+= gnu/lib/libgcc
gnu/lib/libgcc__L: lib/libc__L gnu/lib/libgcc__L: lib/libc__L
gnu/lib/libgcc__L: lib/libc_nonshared__L gnu/lib/libgcc__L: lib/libc_nonshared__L
.if ${MK_LIBCPLUSPLUS} != "no" .if ${MK_LIBCPLUSPLUS} != "no"
lib/libcxxrt__L: gnu/lib/libgcc__L lib/libcxxrt__L: gnu/lib/libgcc__L
.endif .endif
.endif
_prebuild_libs= ${_kerberos5_lib_libasn1} \ _prebuild_libs= ${_kerberos5_lib_libasn1} \
${_kerberos5_lib_libhdb} \ ${_kerberos5_lib_libhdb} \

View File

@ -3,8 +3,6 @@
.include <src.opts.mk> .include <src.opts.mk>
SUBDIR= csu SUBDIR= csu
SUBDIR+= libgcc
SUBDIR.${MK_DIALOG}+= libdialog SUBDIR.${MK_DIALOG}+= libdialog
SUBDIR.${MK_GCC}+= libgcov libgomp SUBDIR.${MK_GCC}+= libgcov libgomp
SUBDIR.${MK_SSP}+= libssp SUBDIR.${MK_SSP}+= libssp
@ -19,6 +17,10 @@ SUBDIR+= libreadline
SUBDIR+= libregex SUBDIR+= libregex
.endif .endif
.if ${MK_LLVM_LIBUNWIND} == "no"
SUBDIR+= libgcc
.endif
# libsupc++ uses libstdc++ headers, although 'make includes' should # libsupc++ uses libstdc++ headers, although 'make includes' should
# have taken care of that already. # have taken care of that already.
.if ${MK_GNUCXX} != "no" .if ${MK_GNUCXX} != "no"

View File

@ -4,9 +4,6 @@ PACKAGE= clibs
GCCDIR= ${.CURDIR}/../../../contrib/gcc GCCDIR= ${.CURDIR}/../../../contrib/gcc
GCCLIB= ${.CURDIR}/../../../contrib/gcclibs GCCLIB= ${.CURDIR}/../../../contrib/gcclibs
CCDIR= ${.CURDIR}/../../usr.bin/cc CCDIR= ${.CURDIR}/../../usr.bin/cc
COMPILERRTDIR= ${.CURDIR}/../../../contrib/compiler-rt
UNWINDINCDIR= ${.CURDIR}/../../../contrib/llvm/projects/libunwind/include
UNWINDSRCDIR= ${.CURDIR}/../../../contrib/llvm/projects/libunwind/src
SHLIB_NAME= libgcc_s.so.1 SHLIB_NAME= libgcc_s.so.1
SHLIBDIR?= /lib SHLIBDIR?= /lib
@ -74,33 +71,6 @@ LIB2FUNCS+= _floatdi${mode} _floatundi${mode}
LIB2ADD = $(LIB2FUNCS_EXTRA) LIB2ADD = $(LIB2FUNCS_EXTRA)
LIB2ADD_ST = $(LIB2FUNCS_STATIC_EXTRA) LIB2ADD_ST = $(LIB2FUNCS_STATIC_EXTRA)
# Additional sources to handle exceptions; overridden by targets as needed.
.if ${MK_LLVM_LIBUNWIND} != "no"
.PATH: ${COMPILERRTDIR}/lib/builtins
.PATH: ${UNWINDSRCDIR}
LIB2ADDEH = gcc_personality_v0.c \
int_util.c \
Unwind-EHABI.cpp \
Unwind-sjlj.c \
UnwindLevel1-gcc-ext.c \
UnwindLevel1.c \
UnwindRegistersRestore.S \
UnwindRegistersSave.S \
libunwind.cpp
CFLAGS+= -I${UNWINDINCDIR} -I${.CURDIR} -D_LIBUNWIND_IS_NATIVE_ONLY
.if empty(CXXFLAGS:M-std=*)
CXXFLAGS+= -std=c++11
.endif
CXXFLAGS+= -fno-rtti
STATIC_CXXFLAGS+= -fvisibility=hidden -fPIC
.if ${MK_DIRDEPS_BUILD} == "yes"
# Avoid dependency on lib/libc++
CFLAGS+= -I${SRCTOP}/contrib/libc++/include
.endif
.else # MK_LLVM_LIBUNWIND
.if ${TARGET_CPUARCH} == "arm" .if ${TARGET_CPUARCH} == "arm"
LIB2ADDEH = unwind-arm.c libunwind-arm.S pr-support.c unwind-c.c LIB2ADDEH = unwind-arm.c libunwind-arm.S pr-support.c unwind-c.c
@ -109,8 +79,6 @@ LIB2ADDEH = unwind-dw2.c unwind-dw2-fde-glibc.c unwind-sjlj.c gthr-gnat.c \
unwind-c.c unwind-c.c
.endif .endif
.endif # MK_LLVM_LIBUNWIND
LIB2ADDEHSTATIC = $(LIB2ADDEH) LIB2ADDEHSTATIC = $(LIB2ADDEH)
LIB2ADDEHSHARED = $(LIB2ADDEH) LIB2ADDEHSHARED = $(LIB2ADDEH)
@ -202,14 +170,7 @@ LIB2_DIVMOD_FUNCS:= ${LIB2_DIVMOD_FUNCS:S/${sym}//g}
.endif .endif
COMMONHDRS= tm.h tconfig.h options.h gthr-default.h COMMONHDRS= tm.h tconfig.h options.h gthr-default.h
.if ${MK_LLVM_LIBUNWIND} != "no"
# unwind.h is a generated file when MK_LLVM_LIBUNWIND == "no", and a stale
# copy may be left behind in OBJDIR when switching, so remove it explicitly.
beforebuild:
@rm -f ${.OBJDIR}/unwind.h
.else
COMMONHDRS+= unwind.h COMMONHDRS+= unwind.h
.endif
#----------------------------------------------------------------------- #-----------------------------------------------------------------------
# #

View File

@ -160,6 +160,8 @@ _libcplusplus= libc++
SUBDIR.${MK_EFI}+= libefivar SUBDIR.${MK_EFI}+= libefivar
SUBDIR.${MK_LIBTHR}+= libthr SUBDIR.${MK_LIBTHR}+= libthr
SUBDIR.${MK_LLVM_LIBUNWIND}+= libgcc_eh
SUBDIR.${MK_LLVM_LIBUNWIND}+= libgcc_s
SUBDIR.${MK_NAND}+= libnandfs SUBDIR.${MK_NAND}+= libnandfs
SUBDIR.${MK_NETGRAPH}+= libnetgraph SUBDIR.${MK_NETGRAPH}+= libnetgraph
SUBDIR.${MK_NIS}+= libypclnt SUBDIR.${MK_NIS}+= libypclnt