diff --git a/Makefile.inc1 b/Makefile.inc1 index ca84c60..88cbe3b 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -151,13 +151,17 @@ CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} .if !make(showconfig) .if !empty(BROKEN_OPTIONS:MBINUTILS_BOOTSTRAP) && \ !defined(CROSS_BINUTILS_PREFIX) -CROSS_BINUTILS_PREFIX=/usr/local/${TARGET_ARCH}-freebsd/bin/ -.if !exists(${CROSS_BINUTILS_PREFIX}) +#CROSS_BINUTILS_PREFIX=/usr/local/${TARGET_ARCH}-freebsd/bin/ +LD_BFD=/usr/local/${TARGET_ARCH}-freebsd/bin/ld +AS=/usr/local/${TARGET_ARCH}-freebsd/bin/as +NM=/usr/local/${TARGET_ARCH}-freebsd/bin/nm +SIZE=/usr/local/${TARGET_ARCH}-freebsd/bin/size +.if !exists(${LD_BFD}) .error In-tree binutils does not support the ${TARGET_ARCH} architecture. Install the ${TARGET_ARCH}-binutils port or package or set CROSS_BINUTILS_PREFIX. .endif .endif .endif -XBINUTILS= AS AR LD NM OBJCOPY OBJDUMP RANLIB SIZE STRINGS +XBINUTILS= AS AR LD LD_BFD NM OBJCOPY OBJDUMP RANLIB SIZE STRINGS .for BINUTIL in ${XBINUTILS} .if defined(CROSS_BINUTILS_PREFIX) && \ exists(${CROSS_BINUTILS_PREFIX}${${BINUTIL}}) @@ -517,7 +521,8 @@ HMAKE+= PATH=${TMPPATH} METALOG=${METALOG} -DNO_ROOT CROSSENV+= CC="${XCC} ${XCFLAGS}" CXX="${XCXX} ${XCXXFLAGS} ${XCFLAGS}" \ CPP="${XCPP} ${XCFLAGS}" \ - AS="${XAS}" AR="${XAR}" LD="${XLD}" NM=${XNM} \ + AS="${XAS}" AR="${XAR}" LD="${XLD}" LD_BFD="${XLD_BFD}" \ + NM=${XNM} \ OBJDUMP=${XOBJDUMP} OBJCOPY="${XOBJCOPY}" \ RANLIB=${XRANLIB} STRINGS=${XSTRINGS} \ SIZE="${XSIZE}" @@ -1812,11 +1817,13 @@ _cc= gnu/usr.bin/cc .if ${MK_USB} != "no" _usb_tools= sys/boot/usb/tools .endif +_lld= usr.bin/clang/lld cross-tools: .MAKE .PHONY .for _tool in \ ${_clang_libs} \ ${_clang} \ + ${_lld} \ ${_binutils} \ ${_elftctools} \ ${_dtrace_tools} \ diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..85cf702 --- /dev/null +++ b/build.sh @@ -0,0 +1,22 @@ +#!/bin/sh +set -e + +export MAKEOBJDIRPREFIX=/tank/emaste/obj + +args= +args="$args -DNO_CLEAN" +#args="$args TARGET=i386" +#args="$args TARGET=arm" +#args="$args TARGET=arm64" +#args="$args TARGET_ARCH=mips64" +#args="$args TARGET_ARCH=powerpc64" +#args="$args TARGET=sparc64" +jflag=-j4 +build() +{ + time nice make $jflag $args buildworld 2>&1 + time nice make $jflag $args buildkernel 2>&1 +} + +truncate -s0 build.log +build | tee -a build.log diff --git a/gnu/usr.bin/binutils/ld/Makefile b/gnu/usr.bin/binutils/ld/Makefile index 5bc3846..d221c21 100644 --- a/gnu/usr.bin/binutils/ld/Makefile +++ b/gnu/usr.bin/binutils/ld/Makefile @@ -6,6 +6,9 @@ ELF_SCR_EXT= x xbn xc xd xdc xdw xn xr xs xsc xsw xu xw .PATH: ${SRCDIR}/ld +# XXX hack to install LLD as ld +SYMLINKS= /tank/emaste/src/llvm/build-debug/bin/lld ${BINDIR}/ld + PROG= ld.bfd MAN= ld.1 SCRIPTDIR= /usr/libdata/ldscripts @@ -49,8 +52,6 @@ CLEANFILES+= ldemul-list.h stringify.sed FILES= ${LDSCRIPTS:S|^|ldscripts/|} FILESDIR= ${SCRIPTDIR} -LINKS= ${BINDIR}/ld.bfd ${BINDIR}/ld - HOST= ${TARGET_TUPLE} LIBSEARCHPATH= \"=/lib\":\"=/usr/lib\" .for ext in ${ELF_SCR_EXT} diff --git a/lib/libc/Makefile b/lib/libc/Makefile index e511c9b..fb55d03 100644 --- a/lib/libc/Makefile +++ b/lib/libc/Makefile @@ -133,6 +133,7 @@ STATICOBJS+=${LIBC_NONSHARED_SRCS:S/.c$/.o/} VERSION_DEF=${LIBC_SRCTOP}/Versions.def SYMBOL_MAPS=${SYM_MAPS} CFLAGS+= -DSYMBOL_VERSIONING +CFLAGS+=-DLIB_MIN_COMPAT=${LIB_MIN_COMPAT} # If there are no machine dependent sources, append all the # machine-independent sources: diff --git a/lib/libcxxrt/Version.map b/lib/libcxxrt/Version.map index 73ef707..5ce67f5 100644 --- a/lib/libcxxrt/Version.map +++ b/lib/libcxxrt/Version.map @@ -42,76 +42,76 @@ CXXABI_1.3 { __gxx_personality_sj0; __gxx_personality_v0; - extern "C++" { - # Type info classes and their destructors - "__cxxabiv1::__array_type_info"; - "__cxxabiv1::__array_type_info::~__array_type_info()"; - "__cxxabiv1::__class_type_info"; - "__cxxabiv1::__class_type_info::~__class_type_info()"; - "__cxxabiv1::__enum_type_info"; - "__cxxabiv1::__enum_type_info::~__enum_type_info()"; - "__cxxabiv1::__function_type_info::"; - "__cxxabiv1::__function_type_info::~__function_type_info()"; - "__cxxabiv1::__fundamental_type_info"; - "__cxxabiv1::__fundamental_type_info::~__fundamental_type_info()"; - "__cxxabiv1::__pbase_type_info"; - "__cxxabiv1::__pbase_type_info::~__pbase_type_info()"; - "__cxxabiv1::__pointer_to_member_type_info"; - "__cxxabiv1::__pointer_to_member_type_info::~__pointer_to_member_type_info()"; - "__cxxabiv1::__pointer_type_info"; - "__cxxabiv1::__pointer_type_info::~__pointer_type_info()"; - "__cxxabiv1::__si_class_type_info"; - "__cxxabiv1::__si_class_type_info::~__si_class_type_info()"; - "__cxxabiv1::__vmi_class_type_info"; - "__cxxabiv1::__vmi_class_type_info::~__vmi_class_type_info()"; - - # vtables typeinfo classes. - "vtable for __cxxabiv1::__array_type_info"; - "vtable for __cxxabiv1::__class_type_info"; - "vtable for __cxxabiv1::__enum_type_info"; - "vtable for __cxxabiv1::__function_type_info"; - "vtable for __cxxabiv1::__fundamental_type_info"; - "vtable for __cxxabiv1::__pbase_type_info"; - "vtable for __cxxabiv1::__pointer_to_member_type_info"; - "vtable for __cxxabiv1::__pointer_type_info"; - "vtable for __cxxabiv1::__si_class_type_info"; - "vtable for __cxxabiv1::__vmi_class_type_info"; - - # Type info for built-in types - "typeinfo for bool const*"; - "typeinfo for bool"; - "typeinfo for char const*"; - "typeinfo for char"; - "typeinfo for double const*"; - "typeinfo for double"; - "typeinfo for float const*"; - "typeinfo for float"; - "typeinfo for int const*"; - "typeinfo for int"; - "typeinfo for long const*"; - "typeinfo for long double const*"; - "typeinfo for long double"; - "typeinfo for long long const*"; - "typeinfo for long long"; - "typeinfo for long"; - "typeinfo for short const*"; - "typeinfo for short"; - "typeinfo for signed char const*"; - "typeinfo for signed char"; - "typeinfo for unsigned char const*"; - "typeinfo for unsigned char"; - "typeinfo for unsigned int const*"; - "typeinfo for unsigned int"; - "typeinfo for unsigned long const*"; - "typeinfo for unsigned long long const*"; - "typeinfo for unsigned long long"; - "typeinfo for unsigned long"; - "typeinfo for unsigned short const*"; - "typeinfo for unsigned short"; - "typeinfo for void const*"; - "typeinfo for void"; - "typeinfo for wchar_t const*"; - "typeinfo for wchar_t"; +# extern "C++" { +# # Type info classes and their destructors +# "__cxxabiv1::__array_type_info"; +# "__cxxabiv1::__array_type_info::~__array_type_info()"; +# "__cxxabiv1::__class_type_info"; +# "__cxxabiv1::__class_type_info::~__class_type_info()"; +# "__cxxabiv1::__enum_type_info"; +# "__cxxabiv1::__enum_type_info::~__enum_type_info()"; +# "__cxxabiv1::__function_type_info::"; +# "__cxxabiv1::__function_type_info::~__function_type_info()"; +# "__cxxabiv1::__fundamental_type_info"; +# "__cxxabiv1::__fundamental_type_info::~__fundamental_type_info()"; +# "__cxxabiv1::__pbase_type_info"; +# "__cxxabiv1::__pbase_type_info::~__pbase_type_info()"; +# "__cxxabiv1::__pointer_to_member_type_info"; +# "__cxxabiv1::__pointer_to_member_type_info::~__pointer_to_member_type_info()"; +# "__cxxabiv1::__pointer_type_info"; +# "__cxxabiv1::__pointer_type_info::~__pointer_type_info()"; +# "__cxxabiv1::__si_class_type_info"; +# "__cxxabiv1::__si_class_type_info::~__si_class_type_info()"; +# "__cxxabiv1::__vmi_class_type_info"; +# "__cxxabiv1::__vmi_class_type_info::~__vmi_class_type_info()"; +# +# # vtables typeinfo classes. +# "vtable for __cxxabiv1::__array_type_info"; + _ZTVN10__cxxabiv117__class_type_infoE; # "vtable for __cxxabiv1::__class_type_info"; +# "vtable for __cxxabiv1::__enum_type_info"; +# "vtable for __cxxabiv1::__function_type_info"; +# "vtable for __cxxabiv1::__fundamental_type_info"; +# "vtable for __cxxabiv1::__pbase_type_info"; +# "vtable for __cxxabiv1::__pointer_to_member_type_info"; +# "vtable for __cxxabiv1::__pointer_type_info"; + _ZTVN10__cxxabiv120__si_class_type_infoE; # "vtable for __cxxabiv1::__si_class_type_info"; +# "vtable for __cxxabiv1::__vmi_class_type_info"; +# +# # Type info for built-in types +# "typeinfo for bool const*"; +# "typeinfo for bool"; +# "typeinfo for char const*"; +# "typeinfo for char"; +# "typeinfo for double const*"; +# "typeinfo for double"; +# "typeinfo for float const*"; +# "typeinfo for float"; +# "typeinfo for int const*"; + _ZTIi; # "typeinfo for int"; +# "typeinfo for long const*"; +# "typeinfo for long double const*"; +# "typeinfo for long double"; +# "typeinfo for long long const*"; +# "typeinfo for long long"; +# "typeinfo for long"; +# "typeinfo for short const*"; +# "typeinfo for short"; +# "typeinfo for signed char const*"; +# "typeinfo for signed char"; +# "typeinfo for unsigned char const*"; +# "typeinfo for unsigned char"; +# "typeinfo for unsigned int const*"; +# "typeinfo for unsigned int"; +# "typeinfo for unsigned long const*"; +# "typeinfo for unsigned long long const*"; +# "typeinfo for unsigned long long"; +# "typeinfo for unsigned long"; +# "typeinfo for unsigned short const*"; +# "typeinfo for unsigned short"; +# "typeinfo for void const*"; +# "typeinfo for void"; +# "typeinfo for wchar_t const*"; +# "typeinfo for wchar_t"; # C++11 typeinfo not understood by our linker # std::nullptr_t _ZTIDn;_ZTIPDn;_ZTIPKDn; @@ -125,90 +125,90 @@ CXXABI_1.3 { _ZTIDf;_ZTIPDf;_ZTIPKDf; # IEEE 754r half-precision floating point _ZTIDh;_ZTIPDh;_ZTIPKDh; - - "typeinfo for bool*"; - "typeinfo for wchar_t*"; - "typeinfo for short*"; - "typeinfo for char*"; - "typeinfo for unsigned char*"; - "typeinfo for long long*"; - "typeinfo for unsigned short*"; - "typeinfo for long*"; - "typeinfo for double*"; - "typeinfo for unsigned long*"; - "typeinfo for unsigned long long*"; - "typeinfo for int*"; - "typeinfo for long double*"; - "typeinfo for signed char*"; - "typeinfo for void*"; - "typeinfo for unsigned int*"; - "typeinfo for float*"; - - "typeinfo for __cxxabiv1::__array_type_info"; - "typeinfo for __cxxabiv1::__class_type_info"; - "typeinfo for __cxxabiv1::__enum_type_info"; - "typeinfo for __cxxabiv1::__function_type_info"; - "typeinfo for __cxxabiv1::__fundamental_type_info"; - "typeinfo for __cxxabiv1::__pbase_type_info"; - "typeinfo for __cxxabiv1::__pointer_to_member_type_info"; - "typeinfo for __cxxabiv1::__pointer_type_info"; - "typeinfo for __cxxabiv1::__si_class_type_info"; - "typeinfo for __cxxabiv1::__vmi_class_type_info"; - - # Typeinfo names. - - "typeinfo name for unsigned char const*"; - "typeinfo name for long const*"; - "typeinfo name for double const*"; - "typeinfo name for unsigned long long const*"; - "typeinfo name for unsigned short const*"; - "typeinfo name for char const*"; - "typeinfo name for long long const*"; - "typeinfo name for short const*"; - "typeinfo name for unsigned int const*"; - "typeinfo name for float const*"; - "typeinfo name for bool const*"; - "typeinfo name for wchar_t const*"; - "typeinfo name for int const*"; - "typeinfo name for unsigned long const*"; - "typeinfo name for void const*"; - "typeinfo name for long double const*"; - "typeinfo name for signed char const*"; - "typeinfo name for wchar_t"; - "typeinfo name for short"; - "typeinfo name for char"; - "typeinfo name for float"; - "typeinfo name for void"; - "typeinfo name for unsigned int"; - "typeinfo name for bool"; - "typeinfo name for signed char"; - "typeinfo name for long double"; - "typeinfo name for int"; - "typeinfo name for unsigned long long"; - "typeinfo name for unsigned long"; - "typeinfo name for unsigned char"; - "typeinfo name for long"; - "typeinfo name for long long"; - "typeinfo name for unsigned short"; - "typeinfo name for double"; - - "typeinfo name for bool*"; - "typeinfo name for wchar_t*"; - "typeinfo name for short*"; - "typeinfo name for char*"; - "typeinfo name for unsigned char*"; - "typeinfo name for long long*"; - "typeinfo name for unsigned short*"; - "typeinfo name for long*"; - "typeinfo name for double*"; - "typeinfo name for unsigned long*"; - "typeinfo name for unsigned long long*"; - "typeinfo name for int*"; - "typeinfo name for long double*"; - "typeinfo name for signed char*"; - "typeinfo name for void*"; - "typeinfo name for unsigned int*"; - "typeinfo name for float*"; +# +# "typeinfo for bool*"; +# "typeinfo for wchar_t*"; +# "typeinfo for short*"; +# "typeinfo for char*"; +# "typeinfo for unsigned char*"; +# "typeinfo for long long*"; +# "typeinfo for unsigned short*"; +# "typeinfo for long*"; +# "typeinfo for double*"; +# "typeinfo for unsigned long*"; +# "typeinfo for unsigned long long*"; +# "typeinfo for int*"; +# "typeinfo for long double*"; +# "typeinfo for signed char*"; +# "typeinfo for void*"; +# "typeinfo for unsigned int*"; +# "typeinfo for float*"; +# +# "typeinfo for __cxxabiv1::__array_type_info"; +# "typeinfo for __cxxabiv1::__class_type_info"; +# "typeinfo for __cxxabiv1::__enum_type_info"; +# "typeinfo for __cxxabiv1::__function_type_info"; +# "typeinfo for __cxxabiv1::__fundamental_type_info"; +# "typeinfo for __cxxabiv1::__pbase_type_info"; +# "typeinfo for __cxxabiv1::__pointer_to_member_type_info"; +# "typeinfo for __cxxabiv1::__pointer_type_info"; +# "typeinfo for __cxxabiv1::__si_class_type_info"; +# "typeinfo for __cxxabiv1::__vmi_class_type_info"; +# +# # Typeinfo names. +# +# "typeinfo name for unsigned char const*"; +# "typeinfo name for long const*"; +# "typeinfo name for double const*"; +# "typeinfo name for unsigned long long const*"; +# "typeinfo name for unsigned short const*"; +# "typeinfo name for char const*"; +# "typeinfo name for long long const*"; +# "typeinfo name for short const*"; +# "typeinfo name for unsigned int const*"; +# "typeinfo name for float const*"; +# "typeinfo name for bool const*"; +# "typeinfo name for wchar_t const*"; +# "typeinfo name for int const*"; +# "typeinfo name for unsigned long const*"; +# "typeinfo name for void const*"; +# "typeinfo name for long double const*"; +# "typeinfo name for signed char const*"; +# "typeinfo name for wchar_t"; +# "typeinfo name for short"; +# "typeinfo name for char"; +# "typeinfo name for float"; +# "typeinfo name for void"; +# "typeinfo name for unsigned int"; +# "typeinfo name for bool"; +# "typeinfo name for signed char"; +# "typeinfo name for long double"; +# "typeinfo name for int"; +# "typeinfo name for unsigned long long"; +# "typeinfo name for unsigned long"; +# "typeinfo name for unsigned char"; +# "typeinfo name for long"; +# "typeinfo name for long long"; +# "typeinfo name for unsigned short"; +# "typeinfo name for double"; +# +# "typeinfo name for bool*"; +# "typeinfo name for wchar_t*"; +# "typeinfo name for short*"; +# "typeinfo name for char*"; +# "typeinfo name for unsigned char*"; +# "typeinfo name for long long*"; +# "typeinfo name for unsigned short*"; +# "typeinfo name for long*"; +# "typeinfo name for double*"; +# "typeinfo name for unsigned long*"; +# "typeinfo name for unsigned long long*"; +# "typeinfo name for int*"; +# "typeinfo name for long double*"; +# "typeinfo name for signed char*"; +# "typeinfo name for void*"; +# "typeinfo name for unsigned int*"; +# "typeinfo name for float*"; # C++11 typeinfo name not understood by our linker # std::nullptr_t _ZTSDn;_ZTSPDn;_ZTSPKDn; @@ -222,29 +222,29 @@ CXXABI_1.3 { _ZTSDf;_ZTSPDf;_ZTSPKDf; # IEEE 754r half-precision floating point _ZTSDh;_ZTSPDh;_ZTSPKDh; - - "typeinfo name for __cxxabiv1::__array_type_info"; - "typeinfo name for __cxxabiv1::__class_type_info"; - "typeinfo name for __cxxabiv1::__enum_type_info"; - "typeinfo name for __cxxabiv1::__function_type_info"; - "typeinfo name for __cxxabiv1::__fundamental_type_info"; - "typeinfo name for __cxxabiv1::__pbase_type_info"; - "typeinfo name for __cxxabiv1::__pointer_to_member_type_info"; - "typeinfo name for __cxxabiv1::__pointer_type_info"; - "typeinfo name for __cxxabiv1::__si_class_type_info"; - "typeinfo name for __cxxabiv1::__vmi_class_type_info"; - - "std::type_info::type_info(std::type_info const&)"; - "std::type_info::operator=(std::type_info const&)"; - - - # Extensions - "pathscale::set_terminate(void (*)())"; - "pathscale::set_unexpected(void (*)())"; - "pathscale::set_use_thread_local_handlers(bool)"; - - - }; +# +# "typeinfo name for __cxxabiv1::__array_type_info"; +# "typeinfo name for __cxxabiv1::__class_type_info"; +# "typeinfo name for __cxxabiv1::__enum_type_info"; +# "typeinfo name for __cxxabiv1::__function_type_info"; +# "typeinfo name for __cxxabiv1::__fundamental_type_info"; +# "typeinfo name for __cxxabiv1::__pbase_type_info"; +# "typeinfo name for __cxxabiv1::__pointer_to_member_type_info"; +# "typeinfo name for __cxxabiv1::__pointer_type_info"; +# "typeinfo name for __cxxabiv1::__si_class_type_info"; +# "typeinfo name for __cxxabiv1::__vmi_class_type_info"; +# +# "std::type_info::type_info(std::type_info const&)"; +# "std::type_info::operator=(std::type_info const&)"; +# +# +# # Extensions +# "pathscale::set_terminate(void (*)())"; +# "pathscale::set_unexpected(void (*)())"; +# "pathscale::set_use_thread_local_handlers(bool)"; +# +# +# }; local: *; @@ -261,28 +261,28 @@ CXXABI_1.3.6 { CXXRT_1.0 { - extern "C++" { - "std::type_info::name() const"; - "std::type_info::before(std::type_info const&) const"; - "std::type_info::operator==(std::type_info const&) const"; - "std::type_info::operator!=(std::type_info const&) const"; - "std::bad_cast::bad_cast(std::bad_cast const&)"; - "std::bad_cast::bad_cast()"; - "std::bad_cast::operator=(std::bad_cast const&)"; - "std::bad_typeid::bad_typeid(std::bad_typeid const&)"; - "std::bad_typeid::bad_typeid()"; - "std::bad_typeid::operator=(std::bad_typeid const&)"; - "std::exception::exception(std::exception const&)"; - "std::exception::exception()"; - "std::exception::operator=(std::exception const&)"; - "std::bad_alloc::bad_alloc(std::bad_alloc const&)"; - "std::bad_alloc::bad_alloc()"; - "std::bad_alloc::operator=(std::bad_alloc const&)"; - "std::bad_array_new_length::bad_array_new_length(std::bad_array_new_length const&)"; - "std::bad_array_new_length::bad_array_new_length()"; - "std::bad_array_new_length::operator=(std::bad_array_new_length const&)"; - - }; +# extern "C++" { +# "std::type_info::name() const"; +# "std::type_info::before(std::type_info const&) const"; +# "std::type_info::operator==(std::type_info const&) const"; +# "std::type_info::operator!=(std::type_info const&) const"; +# "std::bad_cast::bad_cast(std::bad_cast const&)"; + _ZNSt8bad_castC1Ev; # "std::bad_cast::bad_cast()"; +# "std::bad_cast::operator=(std::bad_cast const&)"; +# "std::bad_typeid::bad_typeid(std::bad_typeid const&)"; +# "std::bad_typeid::bad_typeid()"; +# "std::bad_typeid::operator=(std::bad_typeid const&)"; +# "std::exception::exception(std::exception const&)"; +# "std::exception::exception()"; +# "std::exception::operator=(std::exception const&)"; +# "std::bad_alloc::bad_alloc(std::bad_alloc const&)"; +# "std::bad_alloc::bad_alloc()"; +# "std::bad_alloc::operator=(std::bad_alloc const&)"; +# "std::bad_array_new_length::bad_array_new_length(std::bad_array_new_length const&)"; +# "std::bad_array_new_length::bad_array_new_length()"; +# "std::bad_array_new_length::operator=(std::bad_array_new_length const&)"; +# +# }; __cxa_allocate_dependent_exception; __cxa_current_primary_exception; __cxa_decrement_exception_refcount; @@ -294,71 +294,71 @@ CXXRT_1.0 { GLIBCXX_3.4 { - extern "C++" { - "operator delete[](void*)"; - "operator delete(void*)"; - "operator new[](unsigned int)"; - "operator new(unsigned int)"; - "operator new(unsigned int, std::nothrow_t const&)"; - "operator new[](unsigned long)"; - "operator new(unsigned long)"; - "operator new(unsigned long, std::nothrow_t const&)"; - - "std::unexpected()"; - "std::get_terminate()"; - "std::get_unexpected()"; - "std::uncaught_exception()"; - "std::terminate()"; - - "std::type_info::~type_info()"; - "std::bad_cast::~bad_cast()"; - "std::bad_typeid::~bad_typeid()"; - "std::exception::~exception()"; - "std::bad_alloc::~bad_alloc()"; - "std::bad_array_new_length::~bad_array_new_length()"; - - "std::exception::what() const"; - - std::set_new_handler*; - std::set_terminate*; - std::set_unexpected*; - std::type_info::__*; - - "vtable for std::bad_alloc"; - "vtable for std::bad_cast"; - "vtable for std::bad_typeid"; - "vtable for std::exception"; - "vtable for std::type_info"; - "vtable for std::bad_array_new_length"; - - "typeinfo for std::bad_alloc"; - "typeinfo for std::bad_typeid"; - "typeinfo for std::bad_cast"; - "typeinfo for std::exception"; - "typeinfo for std::type_info"; - "typeinfo for std::bad_array_new_length"; - "typeinfo name for std::bad_alloc"; - "typeinfo name for std::bad_typeid"; - "typeinfo name for std::bad_cast"; - "typeinfo name for std::exception"; - "typeinfo name for std::type_info"; - "typeinfo name for std::bad_array_new_length"; - - }; +# extern "C++" { +# "operator delete[](void*)"; +# "operator delete(void*)"; +# "operator new[](unsigned int)"; +# "operator new(unsigned int)"; +# "operator new(unsigned int, std::nothrow_t const&)"; +# "operator new[](unsigned long)"; +# "operator new(unsigned long)"; +# "operator new(unsigned long, std::nothrow_t const&)"; +# +# "std::unexpected()"; +# "std::get_terminate()"; +# "std::get_unexpected()"; +# "std::uncaught_exception()"; + _ZSt9terminatev; # "std::terminate()"; +# +# "std::type_info::~type_info()"; + _ZNSt8bad_castD1Ev; # "std::bad_cast::~bad_cast()"; +# "std::bad_typeid::~bad_typeid()"; +# "std::exception::~exception()"; +# "std::bad_alloc::~bad_alloc()"; +# "std::bad_array_new_length::~bad_array_new_length()"; +# +# "std::exception::what() const"; +# +# std::set_new_handler*; +# std::set_terminate*; +# std::set_unexpected*; +# std::type_info::__*; +# +# "vtable for std::bad_alloc"; +# "vtable for std::bad_cast"; +# "vtable for std::bad_typeid"; +# "vtable for std::exception"; +# "vtable for std::type_info"; +# "vtable for std::bad_array_new_length"; +# + _ZTISt9bad_alloc; # "typeinfo for std::bad_alloc"; +# "typeinfo for std::bad_typeid"; + _ZTISt8bad_cast; # "typeinfo for std::bad_cast"; + _ZTISt9exception; # "typeinfo for std::exception"; +# "typeinfo for std::type_info"; +# "typeinfo for std::bad_array_new_length"; +# "typeinfo name for std::bad_alloc"; +# "typeinfo name for std::bad_typeid"; +# "typeinfo name for std::bad_cast"; +# "typeinfo name for std::exception"; +# "typeinfo name for std::type_info"; +# "typeinfo name for std::bad_array_new_length"; +# +# }; }; GLIBCXX_3.4.9 { - extern "C++" { - "std::bad_typeid::what() const"; - "std::bad_cast::what() const"; - "std::bad_alloc::what() const"; - "std::bad_array_new_length::what() const"; - }; +# extern "C++" { +# "std::bad_typeid::what() const"; +# "std::bad_cast::what() const"; +# "std::bad_alloc::what() const"; +# "std::bad_array_new_length::what() const"; +# }; } GLIBCXX_3.4; GLIBCXX_3.4.22 { - extern "C++" { - "std::uncaught_exceptions()"; - }; +# extern "C++" { +# "std::uncaught_exceptions()"; +# }; } GLIBCXX_3.4.9; diff --git a/lib/libmd/Makefile b/lib/libmd/Makefile index bb50623..9afdc45 100644 --- a/lib/libmd/Makefile +++ b/lib/libmd/Makefile @@ -93,6 +93,7 @@ SRCS+= rmd160.S CFLAGS+= -DRMD160_ASM .endif .if exists(${MACHINE_ARCH}/skein_block_asm.s) +AFLAGS += --strip-local-absolute SRCS+= skein_block_asm.s CFLAGS+= -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to replace with assembly: 256+512+1024 = 1792 .endif diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile index 6ae9130..152f161 100644 --- a/libexec/rtld-elf/Makefile +++ b/libexec/rtld-elf/Makefile @@ -4,6 +4,10 @@ # linker: # make DEBUG_FLAGS=-g DEBUG=-DDEBUG MK_TESTS=no all +# enable debugging +DEBUG_FLAGS=-g +DEBUG=-DDEBUG + .include PACKAGE= clibs MK_SSP= no diff --git a/libexec/rtld-elf/amd64/Makefile.inc b/libexec/rtld-elf/amd64/Makefile.inc index a09db6f..d5e0437 100644 --- a/libexec/rtld-elf/amd64/Makefile.inc +++ b/libexec/rtld-elf/amd64/Makefile.inc @@ -1,6 +1,7 @@ # $FreeBSD$ CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float +# PR 26731 lld linker script support needs to handle arithmetic expressions # Uncomment this to build the dynamic linker as an executable instead # of a shared library: #LDSCRIPT= ${.CURDIR}/${MACHINE_CPUARCH}/elf_rtld.x diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 1869194..f0c7ab5 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -478,8 +478,9 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) if ((ld_elf_hints_path == NULL) || strlen(ld_elf_hints_path) == 0) ld_elf_hints_path = ld_elf_hints_default; - +#ifndef __aarch64__ if (ld_debug != NULL && *ld_debug != '\0') +#endif debug = 1; dbg("%s is initialized, base address = %p", __progname, (caddr_t) aux_info[AT_BASE]->a_un.a_ptr); @@ -685,9 +686,12 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) } wlock_acquire(rtld_bind_lock, &lockstate); + dbg("about to call preinit_main"); if (obj_main->crt_no_init) preinit_main(); + dbg("about to call objlist_call_init"); objlist_call_init(&initlist, &lockstate); + dbg("about to call _r_debug_postinit"); _r_debug_postinit(&obj_main->linkmap); objlist_clear(&initlist); dbg("loading filtees"); @@ -2535,7 +2539,7 @@ objlist_call_init(Objlist *list, RtldLockState *lockstate) if (init_addr != NULL) { for (index = 0; index < elm->obj->init_array_num; index++) { if (init_addr[index] != 0 && init_addr[index] != 1) { - dbg("calling init function for %s at %p", elm->obj->path, + dbg("calling init array function for %s at %p", elm->obj->path, (void *)init_addr[index]); LD_UTRACE(UTRACE_INIT_CALL, elm->obj, (void *)init_addr[index], 0, 0, elm->obj->path); @@ -2543,6 +2547,7 @@ objlist_call_init(Objlist *list, RtldLockState *lockstate) } } } + dbg("done calling init functions"); wlock_acquire(rtld_bind_lock, lockstate); } errmsg_restore(saved_msg); diff --git a/rescue/rescue/Makefile b/rescue/rescue/Makefile index 70d3a37..6b3412d 100644 --- a/rescue/rescue/Makefile +++ b/rescue/rescue/Makefile @@ -28,7 +28,7 @@ CLEANFILES+= dhclient_FIXED # Define Makefile variable RESCUE CRUNCH_BUILDOPTS+= -DRESCUE # Define compile-time RESCUE symbol when compiling components -CRUNCH_BUILDOPTS+= CRUNCH_CFLAGS=-DRESCUE +CRUNCH_BUILDOPTS+= CRUNCH_CFLAGS="-DRESCUE -fno-common" # An experiment that failed: try overriding bsd.lib.mk and bsd.prog.mk # rather than incorporating rescue-specific logic into standard files. diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index d41eb25..20ee8e1 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -148,7 +148,6 @@ __DEFAULT_YES_OPTIONS = \ RCMDS \ RBOOTD \ RCS \ - RESCUE \ ROUTED \ SENDMAIL \ SETUID_LOGIN \ @@ -187,6 +186,7 @@ __DEFAULT_NO_OPTIONS = \ NAND \ OFED \ OPENLDAP \ + RESCUE \ SHARED_TOOLCHAIN \ SORT_THREADS \ SVN \ diff --git a/share/mk/sys.mk b/share/mk/sys.mk index 3dcd404..cc1883e 100644 --- a/share/mk/sys.mk +++ b/share/mk/sys.mk @@ -216,6 +216,7 @@ LEX ?= lex LFLAGS ?= LD ?= ld +LD_BFD ?= ld.bfd LDFLAGS ?= # LDFLAGS is for CC, _LDFLAGS = ${LDFLAGS:S/-Wl,//g} # strip -Wl, for LD diff --git a/sys/boot/efi/boot1/Makefile b/sys/boot/efi/boot1/Makefile index 0c23945..084c7aaa 100644 --- a/sys/boot/efi/boot1/Makefile +++ b/sys/boot/efi/boot1/Makefile @@ -9,6 +9,7 @@ MK_SSP= no PROG= boot1.sym INTERNALPROG= WARNS?= 6 +LDFLAGS+= -fuse-ld=bfd .if ${MK_ZFS} != "no" # Disable warnings that are currently incompatible with the zfs boot code @@ -56,6 +57,7 @@ LDSCRIPT= ${.CURDIR}/../loader/arch/${MACHINE}/ldscript.${MACHINE} LDFLAGS+= -Wl,-T${LDSCRIPT} -Wl,-Bsymbolic -shared .if ${MACHINE_CPUARCH} == "aarch64" +LDFLAGS+= -B/usr/local/aarch64-freebsd/bin/ CFLAGS+= -msoft-float -mgeneral-regs-only .endif .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" diff --git a/sys/boot/efi/loader/Makefile b/sys/boot/efi/loader/Makefile index 6b1b4ac..825eed8 100644 --- a/sys/boot/efi/loader/Makefile +++ b/sys/boot/efi/loader/Makefile @@ -9,6 +9,10 @@ MK_SSP= no PROG= loader.sym INTERNALPROG= WARNS?= 3 +LDFLAGS+= -fuse-ld=bfd +.if ${MACHINE_CPUARCH} == "aarch64" +LDFLAGS+= -B/usr/local/aarch64-freebsd/bin/ +.endif # architecture-specific loader code SRCS= autoload.c \ diff --git a/sys/boot/i386/boot0/Makefile b/sys/boot/i386/boot0/Makefile index f5faef3..d70ce17 100644 --- a/sys/boot/i386/boot0/Makefile +++ b/sys/boot/i386/boot0/Makefile @@ -74,7 +74,7 @@ CFLAGS+=-DFLAGS=${BOOT_BOOT0_FLAGS} \ -DTICKS=${BOOT_BOOT0_TICKS} \ -DCOMSPEED=${BOOT_BOOT0_COMCONSOLE_SPEED} -LDFLAGS=-e start -Ttext ${BOOT_BOOT0_ORG} -Wl,-N,-S,--oformat,binary +LDFLAGS=-fuse-ld=bfd -e start -Ttext ${BOOT_BOOT0_ORG} -Wl,-N,-S,--oformat,binary .include diff --git a/sys/boot/i386/boot2/Makefile b/sys/boot/i386/boot2/Makefile index 16ed404..3983e17 100644 --- a/sys/boot/i386/boot2/Makefile +++ b/sys/boot/i386/boot2/Makefile @@ -64,7 +64,7 @@ boot1: boot1.out ${OBJCOPY} -S -O binary boot1.out ${.TARGET} boot1.out: boot1.o - ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} boot1.o + ${LD_BFD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} boot1.o CLEANFILES+= boot2 boot2.ld boot2.ldr boot2.bin boot2.out boot2.o \ boot2.s boot2.s.tmp boot2.h sio.o @@ -85,7 +85,7 @@ boot2.bin: boot2.out ${OBJCOPY} -S -O binary boot2.out ${.TARGET} boot2.out: ${BTXCRT} boot2.o sio.o - ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} + ${LD_BFD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} boot2.o: boot2.s ${CC} ${ACFLAGS} -c boot2.s diff --git a/sys/boot/i386/btx/btx/Makefile b/sys/boot/i386/btx/btx/Makefile index a07e000..ed57ac6 100644 --- a/sys/boot/i386/btx/btx/Makefile +++ b/sys/boot/i386/btx/btx/Makefile @@ -25,7 +25,7 @@ CFLAGS+=-DBTX_SERIAL -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ ORG= 0x9000 -LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary +LDFLAGS=-fuse-ld=bfd -e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary .include diff --git a/sys/boot/i386/btx/btxldr/Makefile b/sys/boot/i386/btx/btxldr/Makefile index bf7833d..e60aebd 100644 --- a/sys/boot/i386/btx/btxldr/Makefile +++ b/sys/boot/i386/btx/btxldr/Makefile @@ -12,7 +12,7 @@ CFLAGS+=-I${.CURDIR}/../../common CFLAGS+=-DBTXLDR_VERBOSE .endif -LDFLAGS=-e start -Ttext ${LOADER_ADDRESS} -Wl,-N,-S,--oformat,binary +LDFLAGS=-fuse-ld=bfd -e start -Ttext ${LOADER_ADDRESS} -Wl,-N,-S,--oformat,binary .include diff --git a/sys/boot/i386/btx/lib/Makefile b/sys/boot/i386/btx/lib/Makefile index c66f0fc..2afa5d1 100644 --- a/sys/boot/i386/btx/lib/Makefile +++ b/sys/boot/i386/btx/lib/Makefile @@ -5,6 +5,6 @@ INTERNALPROG= MAN= SRCS= btxcsu.S btxsys.s btxv86.s CFLAGS+=-I${.CURDIR}/../../common -LDFLAGS=-Wl,-r +LDFLAGS=-fuse-ld=bfd -Wl,-r .include diff --git a/sys/boot/i386/cdboot/Makefile b/sys/boot/i386/cdboot/Makefile index e9e046b..26c8349 100644 --- a/sys/boot/i386/cdboot/Makefile +++ b/sys/boot/i386/cdboot/Makefile @@ -10,7 +10,7 @@ CFLAGS+=-I${.CURDIR}/../common ORG= 0x7c00 -LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary +LDFLAGS=-fuse-ld=bfd -e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary .include diff --git a/sys/boot/i386/gptboot/Makefile b/sys/boot/i386/gptboot/Makefile index cc8251c..368a567 100644 --- a/sys/boot/i386/gptboot/Makefile +++ b/sys/boot/i386/gptboot/Makefile @@ -66,7 +66,7 @@ gptldr.bin: gptldr.out ${OBJCOPY} -S -O binary gptldr.out ${.TARGET} gptldr.out: gptldr.o - ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o + ${LD_BFD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o CLEANFILES+= gptboot.bin gptboot.out gptboot.o sio.o crc32.o drv.o \ cons.o util.o ${OPENCRYPTO_XTS} @@ -75,7 +75,7 @@ gptboot.bin: gptboot.out ${OBJCOPY} -S -O binary gptboot.out ${.TARGET} gptboot.out: ${BTXCRT} gptboot.o sio.o crc32.o drv.o cons.o util.o ${OPENCRYPTO_XTS} - ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND} ${LIBGELIBOOT} + ${LD_BFD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND} ${LIBGELIBOOT} gptboot.o: ${.CURDIR}/../../common/ufsread.c diff --git a/sys/boot/i386/gptzfsboot/Makefile b/sys/boot/i386/gptzfsboot/Makefile index 97ddd39..fc3fe239 100644 --- a/sys/boot/i386/gptzfsboot/Makefile +++ b/sys/boot/i386/gptzfsboot/Makefile @@ -64,7 +64,7 @@ gptldr.bin: gptldr.out ${OBJCOPY} -S -O binary gptldr.out ${.TARGET} gptldr.out: gptldr.o - ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o + ${LD_BFD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o CLEANFILES+= gptzfsboot.bin gptzfsboot.out zfsboot.o sio.o cons.o \ drv.o gpt.o util.o ${OPENCRYPTO_XTS} @@ -73,7 +73,7 @@ gptzfsboot.bin: gptzfsboot.out ${OBJCOPY} -S -O binary gptzfsboot.out ${.TARGET} gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o util.o ${OPENCRYPTO_XTS} - ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND} ${LIBGELIBOOT} + ${LD_BFD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND} ${LIBGELIBOOT} zfsboot.o: ${.CURDIR}/../../zfs/zfsimpl.c diff --git a/sys/boot/i386/kgzldr/Makefile b/sys/boot/i386/kgzldr/Makefile index f396ae9..d246357 100644 --- a/sys/boot/i386/kgzldr/Makefile +++ b/sys/boot/i386/kgzldr/Makefile @@ -10,7 +10,7 @@ SRCS= start.s boot.c inflate.c lib.c crt.s sio.s CFLAGS= -Os CFLAGS+=-DKZIP NO_SHARED= -LDFLAGS=-Wl,-r +LDFLAGS=-fuse-ld=bfd -Wl,-r .PATH: ${.CURDIR}/../../../kern BOOT_COMCONSOLE_PORT?= 0x3f8 diff --git a/sys/boot/i386/loader/Makefile b/sys/boot/i386/loader/Makefile index 233876a..ce28c05 100644 --- a/sys/boot/i386/loader/Makefile +++ b/sys/boot/i386/loader/Makefile @@ -75,7 +75,7 @@ CFLAGS+= -I. CLEANFILES= vers.c ${LOADER} ${LOADER}.bin loader.help CFLAGS+= -Wall -LDFLAGS= -static -Ttext 0x0 +LDFLAGS= -fuse-ld=bfd -static -Ttext 0x0 # i386 standalone support library LIBI386= ${.OBJDIR}/../libi386/libi386.a diff --git a/sys/boot/i386/mbr/Makefile b/sys/boot/i386/mbr/Makefile index d1a652c..4288dd6 100644 --- a/sys/boot/i386/mbr/Makefile +++ b/sys/boot/i386/mbr/Makefile @@ -12,6 +12,6 @@ BOOT_MBR_FLAGS?= 0x80 ORG= 0x600 AFLAGS+=--defsym FLAGS=${BOOT_MBR_FLAGS} -LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary +LDFLAGS=-fuse-ld=bfd -e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary .include diff --git a/sys/boot/i386/pmbr/Makefile b/sys/boot/i386/pmbr/Makefile index cc12f49..efd62bb 100644 --- a/sys/boot/i386/pmbr/Makefile +++ b/sys/boot/i386/pmbr/Makefile @@ -9,6 +9,6 @@ SRCS= ${PROG}.s ORG= 0x600 AFLAGS+=--defsym FLAGS=${BOOT_MBR_FLAGS} -LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary +LDFLAGS=-fuse-ld=bfd -e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary .include diff --git a/sys/boot/i386/pxeldr/Makefile b/sys/boot/i386/pxeldr/Makefile index 8de2139..beb58b7 100644 --- a/sys/boot/i386/pxeldr/Makefile +++ b/sys/boot/i386/pxeldr/Makefile @@ -34,7 +34,7 @@ ${BOOT}: ${LDR} ${LOADER} dd if=${.TARGET}.tmp of=${.TARGET} obs=2k conv=osync status=none rm ${.TARGET}.tmp -LDFLAGS+=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary +LDFLAGS+=-fuse-ld=bfd -e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary CLEANFILES+= ${LOADER} diff --git a/sys/boot/i386/zfsboot/Makefile b/sys/boot/i386/zfsboot/Makefile index 7f434a8..fde48c1 100644 --- a/sys/boot/i386/zfsboot/Makefile +++ b/sys/boot/i386/zfsboot/Makefile @@ -52,7 +52,7 @@ zfsboot1: zfsldr.out ${OBJCOPY} -S -O binary zfsldr.out ${.TARGET} zfsldr.out: zfsldr.o - ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} zfsldr.o + ${LD_BFD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} zfsldr.o CLEANFILES+= zfsboot2 zfsboot.ld zfsboot.ldr zfsboot.bin zfsboot.out \ zfsboot.o zfsboot.s zfsboot.s.tmp sio.o cons.o drv.o util.o @@ -78,7 +78,7 @@ zfsboot.bin: zfsboot.out ${OBJCOPY} -S -O binary zfsboot.out ${.TARGET} zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o util.o - ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND} + ${LD_BFD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND} SRCS= zfsboot.c diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk index d5781db..a05741c 100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@ -118,7 +118,7 @@ NORMAL_M= ${AWK} -f $S/tools/makeobjops.awk ${.IMPSRC} -c ; \ ${CC} -c ${CFLAGS} ${WERROR} ${PROF} ${.PREFIX}.c NORMAL_FW= uudecode -o ${.TARGET} ${.ALLSRC} -NORMAL_FWO= ${LD} -b binary --no-warn-mismatch -d -warn-common -r \ +NORMAL_FWO= ${LD_BFD} -b binary --no-warn-mismatch -d -warn-common -r \ -o ${.TARGET} ${.ALLSRC:M*.fw} # Common for dtrace / zfs @@ -184,7 +184,7 @@ MD_ROOT_SIZE_CONFIGURED!= grep MD_ROOT_SIZE opt_md.h || true ; echo SYSTEM_OBJS+= embedfs_${MFS_IMAGE:T:R}.o .endif .endif -SYSTEM_LD= @${LD} -Bdynamic -T ${LDSCRIPT} ${_LDFLAGS} --no-warn-mismatch \ +SYSTEM_LD= @${LD_BFD} -Bdynamic -T ${LDSCRIPT} ${_LDFLAGS} --no-warn-mismatch \ --warn-common --export-dynamic --dynamic-linker /red/herring \ -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symbol gcc2_compiled. ${.TARGET} ; \ diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk index cc9190c..af9b2c2 100644 --- a/sys/conf/kmod.mk +++ b/sys/conf/kmod.mk @@ -170,11 +170,11 @@ CLEANFILES+= ${KMOD:S/$/.c/} ${_firmw:C/\:.*$/.fwo/:T}: ${_firmw:C/\:.*$//} @${ECHO} ${_firmw:C/\:.*$//} ${.ALLSRC:M*${_firmw:C/\:.*$//}} @if [ -e ${_firmw:C/\:.*$//} ]; then \ - ${LD} -b binary --no-warn-mismatch ${_LDFLAGS} \ + ${LD_BFD} -b binary --no-warn-mismatch ${_LDFLAGS} \ -r -d -o ${.TARGET} ${_firmw:C/\:.*$//}; \ else \ ln -s ${.ALLSRC:M*${_firmw:C/\:.*$//}} ${_firmw:C/\:.*$//}; \ - ${LD} -b binary --no-warn-mismatch ${_LDFLAGS} \ + ${LD_BFD} -b binary --no-warn-mismatch ${_LDFLAGS} \ -r -d -o ${.TARGET} ${_firmw:C/\:.*$//}; \ rm ${_firmw:C/\:.*$//}; \ fi @@ -208,7 +208,7 @@ ${PROG}.debug: ${FULLPROG} .if ${__KLD_SHARED} == yes ${FULLPROG}: ${KMOD}.kld .if ${MACHINE_CPUARCH} != "aarch64" - ${LD} -Bshareable ${_LDFLAGS} -o ${.TARGET} ${KMOD}.kld + ${LD_BFD} -Bshareable ${_LDFLAGS} -o ${.TARGET} ${KMOD}.kld .else #XXXKIB Relocatable linking in aarch64 ld from binutils 2.25.1 does # not work. The linker corrupts the references to the external @@ -216,7 +216,7 @@ ${FULLPROG}: ${KMOD}.kld # and should therefore loose the GOT entry. The problem seems # to be fixed in the binutils-gdb git HEAD as of 2015-10-04. Hack # below allows to get partially functioning modules for now. - ${LD} -Bshareable ${_LDFLAGS} -o ${.TARGET} ${OBJS} + ${LD_BFD} -Bshareable ${_LDFLAGS} -o ${.TARGET} ${OBJS} .endif .if !defined(DEBUG_FLAGS) ${OBJCOPY} --strip-debug ${.TARGET} @@ -233,7 +233,7 @@ ${KMOD}.kld: ${OBJS} .else ${FULLPROG}: ${OBJS} .endif - ${LD} ${_LDFLAGS} -r -d -o ${.TARGET} ${OBJS} + ${LD_BFD} ${_LDFLAGS} -r -d -o ${.TARGET} ${OBJS} .if ${MK_CTF} != "no" ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS} .endif diff --git a/sys/modules/linux/Makefile b/sys/modules/linux/Makefile index f262972..ce1562b 100644 --- a/sys/modules/linux/Makefile +++ b/sys/modules/linux/Makefile @@ -54,6 +54,7 @@ linux${SFX}_locore.o: linux${SFX}_assym.h assym.s -fno-omit-frame-pointer -fPIC \ -Wl,-T${.CURDIR}/../../${MACHINE_CPUARCH}/linux${SFX}/${VDSO}.lds.s \ -Wl,-soname=${VDSO}.so.1,--eh-frame-hdr,-warn-common \ + -fuse-ld=bfd \ ${.IMPSRC} -o ${.TARGET} linux${SFX}_support.o: linux${SFX}_assym.h assym.s diff --git a/sys/modules/linux64/Makefile b/sys/modules/linux64/Makefile index 1693a50..2d37c77 100644 --- a/sys/modules/linux64/Makefile +++ b/sys/modules/linux64/Makefile @@ -30,6 +30,7 @@ linux_locore.o: linux_locore.s linux_assym.h -pipe -I. -I${SYSDIR} -Werror -Wall -fno-common -fPIC -nostdinc \ -Wl,-T${.CURDIR}/../../${MACHINE_CPUARCH}/linux/${VDSO}.lds.s \ -Wl,-soname=${VDSO}.so.1,-warn-common -nostdlib \ + -fuse-ld=bfd \ ${.IMPSRC} -o ${.TARGET} ${VDSO}.so: linux_locore.o diff --git a/usr.bin/clang/lld/Makefile b/usr.bin/clang/lld/Makefile new file mode 100644 index 0000000..b3e4eed --- /dev/null +++ b/usr.bin/clang/lld/Makefile @@ -0,0 +1,7 @@ +BINDIR?= /usr/bin + +# XXX hack to install LLD as ld +SYMLINKS= /tank/emaste/src/llvm/build-debug/bin/lld ${BINDIR}/ld + +.include + diff --git a/usr.sbin/crunch/crunchgen/crunchgen.c b/usr.sbin/crunch/crunchgen/crunchgen.c index 7a63c91..8ccdad9 100644 --- a/usr.sbin/crunch/crunchgen/crunchgen.c +++ b/usr.sbin/crunch/crunchgen/crunchgen.c @@ -1115,7 +1115,7 @@ prog_makefile_rules(FILE *outmk, prog_t *p) fprintf(outmk, " $(%s_LIBS)", p->ident); fprintf(outmk, "\n"); - fprintf(outmk, "\t$(CC) -nostdlib -Wl,-dc -r -o %s.lo %s_stub.o $(%s_OBJPATHS)", + fprintf(outmk, "\t$(CC) -nostdlib -r -o %s.lo %s_stub.o $(%s_OBJPATHS)", p->name, p->name, p->ident); if (p->libs) fprintf(outmk, " $(%s_LIBS)", p->ident);