Changeset View
Changeset View
Standalone View
Standalone View
libexec/rtld-elf/Makefile
Show All 31 Lines | |||||
CFLAGS+= -Wall -DFREEBSD_ELF -DIN_RTLD -ffreestanding | CFLAGS+= -Wall -DFREEBSD_ELF -DIN_RTLD -ffreestanding | ||||
CFLAGS+= -I${SRCTOP}/lib/csu/common | CFLAGS+= -I${SRCTOP}/lib/csu/common | ||||
.if exists(${RTLD_ELF_DIR}/${MACHINE_ARCH}) | .if exists(${RTLD_ELF_DIR}/${MACHINE_ARCH}) | ||||
RTLD_ARCH= ${MACHINE_ARCH} | RTLD_ARCH= ${MACHINE_ARCH} | ||||
.else | .else | ||||
RTLD_ARCH= ${MACHINE_CPUARCH} | RTLD_ARCH= ${MACHINE_CPUARCH} | ||||
.endif | .endif | ||||
CFLAGS+= -I${RTLD_ELF_DIR}/${RTLD_ARCH} -I${RTLD_ELF_DIR} | 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 | |||||
brooks: `-nostdlib` seems like it should be here not duplicated. I'd be tempted to make this:
```… | |||||
NO_WCAST_ALIGN= yes | NO_WCAST_ALIGN= yes | ||||
WARNS?= 6 | WARNS?= 6 | ||||
INSTALLFLAGS= -C -b | INSTALLFLAGS= -C -b | ||||
PRECIOUSPROG= | PRECIOUSPROG= | ||||
BINDIR= /libexec | BINDIR= /libexec | ||||
SYMLINKS= ../..${BINDIR}/${PROG} ${LIBEXECDIR}/${PROG} | SYMLINKS= ../..${BINDIR}/${PROG} ${LIBEXECDIR}/${PROG} | ||||
MLINKS?= rtld.1 ld-elf.so.1.1 \ | MLINKS?= rtld.1 ld-elf.so.1.1 \ | ||||
rtld.1 ld.so.1 | rtld.1 ld.so.1 | ||||
.if ${MACHINE_CPUARCH} == "sparc64" | |||||
CFLAGS+= -fPIC | |||||
.else | |||||
CFLAGS+= -fpic | |||||
.endif | |||||
brooksUnsubmitted Done Inline ActionsGiven that sparc64 is heading for the dumpster, I'd be tempted to add -fpic below and a CFLAGS:=${CFLAGS:S/-fpic/-fPIC} in sparc64/Makefile.inc. brooks: Given that sparc64 is heading for the dumpster, I'd be tempted to add `-fpic` below and a… | |||||
CFLAGS+= -DPIC $(DEBUG) | 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 | LDFLAGS+= -shared -Wl,-Bsymbolic -Wl,-z,defs | ||||
# Pull in the dependencies that we use from libc | # Pull in the dependencies that we use from libc | ||||
.include "rtld-libc/Makefile.inc" | .include "rtld-libc/Makefile.inc" | ||||
.if ${MK_TOOLCHAIN} == "no" | .if ${MK_TOOLCHAIN} == "no" | ||||
LDFLAGS+= -L${LIBCDIR} | LDFLAGS+= -L${LIBCDIR} | ||||
.endif | .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" | |||||
impUnsubmitted Done Inline ActionsIs removing the non-symbol versioning support intentional? imp: Is removing the non-symbol versioning support intentional?
| |||||
VERSION_DEF= ${LIBCSRCDIR}/Versions.def | VERSION_DEF= ${LIBCSRCDIR}/Versions.def | ||||
SYMBOL_MAPS= ${RTLD_ELF_DIR}/Symbol.map | SYMBOL_MAPS= ${RTLD_ELF_DIR}/Symbol.map | ||||
VERSION_MAP= Version.map | VERSION_MAP= Version.map | ||||
LDFLAGS+= -Wl,--version-script=${VERSION_MAP} | LDFLAGS+= -Wl,--version-script=${VERSION_MAP} | ||||
.if exists(${RTLD_ELF_DIR}/${RTLD_ARCH}/Symbol.map) | .if exists(${RTLD_ELF_DIR}/${RTLD_ARCH}/Symbol.map) | ||||
SYMBOL_MAPS+= ${RTLD_ELF_DIR}/${RTLD_ARCH}/Symbol.map | SYMBOL_MAPS+= ${RTLD_ELF_DIR}/${RTLD_ARCH}/Symbol.map | ||||
.endif | |||||
.endif | .endif | ||||
.sinclude "${RTLD_ELF_DIR}/${RTLD_ARCH}/Makefile.inc" | .sinclude "${RTLD_ELF_DIR}/${RTLD_ARCH}/Makefile.inc" | ||||
# Since moving rtld-elf to /libexec, we need to create a symlink. | # 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. | # Fixup the existing binary that's there so we can symlink over it. | ||||
beforeinstall: | beforeinstall: | ||||
.if exists(${DESTDIR}/usr/libexec/${PROG}) && ${MK_STAGING} == "no" | .if exists(${DESTDIR}/usr/libexec/${PROG}) && ${MK_STAGING} == "no" | ||||
Show All 23 Lines |
-nostdlib seems like it should be here not duplicated. I'd be tempted to make this:
with an overriding in the powerpc file(s).