From owner-svn-src-head@freebsd.org Sat Jan 11 09:19:00 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1366C223458; Sat, 11 Jan 2020 09:19:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47vvRl6ltPz3HPs; Sat, 11 Jan 2020 09:18:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E317F783; Sat, 11 Jan 2020 09:18:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00B9IxCt091013; Sat, 11 Jan 2020 09:18:59 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00B9Iwhj091004; Sat, 11 Jan 2020 09:18:58 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202001110918.00B9Iwhj091004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 11 Jan 2020 09:18:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356631 - in head/libexec/rtld-elf: . amd64 arm i386 mips powerpc64 sparc64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/libexec/rtld-elf: . amd64 arm i386 mips powerpc64 sparc64 X-SVN-Commit-Revision: 356631 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jan 2020 09:19:00 -0000 Author: kib Date: Sat Jan 11 09:18:58 2020 New Revision: 356631 URL: https://svnweb.freebsd.org/changeset/base/356631 Log: rtld: clean up Makefile. Move all MD statements into $MACHINE_ARCH/Makefile.inc. Unconditionally apply version script to rtld, the interpreter is not functional without it for long time. Reviewed by: brooks, emaste Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D23083 Added: head/libexec/rtld-elf/mips/Makefile.inc (contents, props changed) Modified: head/libexec/rtld-elf/Makefile head/libexec/rtld-elf/amd64/Makefile.inc head/libexec/rtld-elf/arm/Makefile.inc head/libexec/rtld-elf/i386/Makefile.inc head/libexec/rtld-elf/powerpc64/Makefile.inc head/libexec/rtld-elf/sparc64/Makefile.inc Modified: head/libexec/rtld-elf/Makefile ============================================================================== --- head/libexec/rtld-elf/Makefile Sat Jan 11 09:08:02 2020 (r356630) +++ head/libexec/rtld-elf/Makefile Sat Jan 11 09:18:58 2020 (r356631) @@ -37,11 +37,6 @@ RTLD_ARCH= ${MACHINE_ARCH} 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,36 +47,14 @@ SYMLINKS= ../..${BINDIR}/${PROG} ${LIBEXECDIR}/${PROG} 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 +CFLAGS+= -fpic -DPIC $(DEBUG) +LDFLAGS+= -shared -Wl,-Bsymbolic -Wl,-z,defs -nostdlib -e ${RTLD_ENTRY} # Pull in the dependencies that we use from libc .include "rtld-libc/Makefile.inc" .if ${MK_TOOLCHAIN} == "no" 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,9 +63,9 @@ LDFLAGS+= -Wl,--version-script=${VERSION_MAP} .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" +RTLD_ENTRY?= .rtld_start # Since moving rtld-elf to /libexec, we need to create a symlink. # Fixup the existing binary that's there so we can symlink over it. Modified: head/libexec/rtld-elf/amd64/Makefile.inc ============================================================================== --- head/libexec/rtld-elf/amd64/Makefile.inc Sat Jan 11 09:08:02 2020 (r356630) +++ head/libexec/rtld-elf/amd64/Makefile.inc Sat Jan 11 09:18:58 2020 (r356631) @@ -1,3 +1,3 @@ # $FreeBSD$ -CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float +CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float -fvisibility=hidden Modified: head/libexec/rtld-elf/arm/Makefile.inc ============================================================================== --- head/libexec/rtld-elf/arm/Makefile.inc Sat Jan 11 09:08:02 2020 (r356630) +++ head/libexec/rtld-elf/arm/Makefile.inc Sat Jan 11 09:18:58 2020 (r356631) @@ -1 +1,7 @@ # $FreeBSD$ + +# 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 Modified: head/libexec/rtld-elf/i386/Makefile.inc ============================================================================== --- head/libexec/rtld-elf/i386/Makefile.inc Sat Jan 11 09:08:02 2020 (r356630) +++ head/libexec/rtld-elf/i386/Makefile.inc Sat Jan 11 09:18:58 2020 (r356631) @@ -1,3 +1,3 @@ # $FreeBSD$ -CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float +CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float -fvisibility=hidden Added: head/libexec/rtld-elf/mips/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/rtld-elf/mips/Makefile.inc Sat Jan 11 09:18:58 2020 (r356631) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +CFLAGS.reloc.c+=-fno-jump-tables Modified: head/libexec/rtld-elf/powerpc64/Makefile.inc ============================================================================== --- head/libexec/rtld-elf/powerpc64/Makefile.inc Sat Jan 11 09:08:02 2020 (r356630) +++ head/libexec/rtld-elf/powerpc64/Makefile.inc Sat Jan 11 09:18:58 2020 (r356631) @@ -1 +1,3 @@ # $FreeBSD$ + +RTLD_ENTRY= _rtld_start Modified: head/libexec/rtld-elf/sparc64/Makefile.inc ============================================================================== --- head/libexec/rtld-elf/sparc64/Makefile.inc Sat Jan 11 09:08:02 2020 (r356630) +++ head/libexec/rtld-elf/sparc64/Makefile.inc Sat Jan 11 09:18:58 2020 (r356631) @@ -1 +1,3 @@ # $FreeBSD$ + +CFLAGS:=${CFLAGS:S/-fpic/-fPIC/}