Index: libexec/rtld-elf/Makefile =================================================================== --- libexec/rtld-elf/Makefile +++ libexec/rtld-elf/Makefile @@ -37,11 +37,6 @@ RTLD_ARCH= ${MACHINE_CPUARCH} .endif CFLAGS+= -I${RTLD_ELF_DIR}/${RTLD_ARCH} -I${RTLD_ELF_DIR} -.if ${MACHINE_ARCH} == "powerpc64" -LDFLAGS+= -nostdlib -e _rtld_start -.else -LDFLAGS+= -nostdlib -e .rtld_start -.endif NO_WCAST_ALIGN= yes WARNS?= 6 @@ -52,18 +47,7 @@ MLINKS?= rtld.1 ld-elf.so.1.1 \ rtld.1 ld.so.1 -.if ${MACHINE_CPUARCH} == "sparc64" -CFLAGS+= -fPIC -.else -CFLAGS+= -fpic -.endif CFLAGS+= -DPIC $(DEBUG) -.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" -CFLAGS+= -fvisibility=hidden -.endif -.if ${MACHINE_CPUARCH} == "mips" -CFLAGS.reloc.c+=-fno-jump-tables -.endif LDFLAGS+= -shared -Wl,-Bsymbolic -Wl,-z,defs # Pull in the dependencies that we use from libc .include "rtld-libc/Makefile.inc" @@ -71,17 +55,6 @@ LDFLAGS+= -L${LIBCDIR} .endif -.if ${MACHINE_CPUARCH} == "arm" -# Some of the required math functions (div & mod) are implemented in -# libcompiler_rt on ARM. The library also needs to be placed first to be -# correctly linked. As some of the functions are used before we have -# shared libraries. -LIBADD+= compiler_rt -.endif - - - -.if ${MK_SYMVER} == "yes" VERSION_DEF= ${LIBCSRCDIR}/Versions.def SYMBOL_MAPS= ${RTLD_ELF_DIR}/Symbol.map VERSION_MAP= Version.map @@ -90,7 +63,6 @@ .if exists(${RTLD_ELF_DIR}/${RTLD_ARCH}/Symbol.map) SYMBOL_MAPS+= ${RTLD_ELF_DIR}/${RTLD_ARCH}/Symbol.map .endif -.endif .sinclude "${RTLD_ELF_DIR}/${RTLD_ARCH}/Makefile.inc" Index: libexec/rtld-elf/aarch64/Makefile.inc =================================================================== --- /dev/null +++ libexec/rtld-elf/aarch64/Makefile.inc @@ -0,0 +1,4 @@ +# $FreeBSD$ + +CFLAGS+= -fpic +LDFLAGS+= -nostdlib -e .rtld_start Index: libexec/rtld-elf/amd64/Makefile.inc =================================================================== --- libexec/rtld-elf/amd64/Makefile.inc +++ libexec/rtld-elf/amd64/Makefile.inc @@ -1,3 +1,5 @@ # $FreeBSD$ CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float +CFLAGS+= -fpic -fvisibility=hidden +LDFLAGS+= -nostdlib -e .rtld_start Index: libexec/rtld-elf/arm/Makefile.inc =================================================================== --- libexec/rtld-elf/arm/Makefile.inc +++ libexec/rtld-elf/arm/Makefile.inc @@ -1 +1,10 @@ # $FreeBSD$ + +CFLAGS+= -fpic +LDFLAGS+= -nostdlib -e .rtld_start + +# Some of the required math functions (div & mod) are implemented in +# libcompiler_rt on ARM. The library also needs to be placed first to be +# correctly linked. As some of the functions are used before we have +# shared libraries. +LIBADD+= compiler_rt Index: libexec/rtld-elf/i386/Makefile.inc =================================================================== --- libexec/rtld-elf/i386/Makefile.inc +++ libexec/rtld-elf/i386/Makefile.inc @@ -1,3 +1,5 @@ # $FreeBSD$ CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float +CFLAGS+= -fpic -fvisibility=hidden +LDFLAGS+= -nostdlib -e .rtld_start Index: libexec/rtld-elf/mips/Makefile.inc =================================================================== --- /dev/null +++ libexec/rtld-elf/mips/Makefile.inc @@ -0,0 +1,5 @@ +# $FreeBSD$ + +CFLAGS+= -fpic +CFLAGS.reloc.c+=-fno-jump-tables +LDFLAGS+= -nostdlib -e .rtld_start Index: libexec/rtld-elf/powerpc64/Makefile.inc =================================================================== --- libexec/rtld-elf/powerpc64/Makefile.inc +++ libexec/rtld-elf/powerpc64/Makefile.inc @@ -1 +1,4 @@ # $FreeBSD$ + +LDFLAGS+= -nostdlib -e _rtld_start +CFLAGS+= -fpic Index: libexec/rtld-elf/riscv/Makefile.inc =================================================================== --- /dev/null +++ libexec/rtld-elf/riscv/Makefile.inc @@ -0,0 +1,4 @@ +# $FreeBSD$ + +CFLAGS+= -fpic +LDFLAGS+= -nostdlib -e .rtld_start Index: libexec/rtld-elf/sparc64/Makefile.inc =================================================================== --- libexec/rtld-elf/sparc64/Makefile.inc +++ libexec/rtld-elf/sparc64/Makefile.inc @@ -1 +1,4 @@ # $FreeBSD$ + +CFLAGS+= -fPIC +LDFLAGS+= -nostdlib -e .rtld_start