Lines 60-65
Link Here
|
60 |
fi |
60 |
fi |
61 |
} |
61 |
} |
|
|
62 |
src_prepare() { |
63 |
cp "${FILESDIR}/__stack_chk_fail_local.c" "$T/" |
64 |
default |
65 |
} |
66 |
|
62 |
src_configure() { |
67 |
src_configure() { |
63 |
tc-getCC ${CTARGET} |
68 |
tc-getCC ${CTARGET} |
64 |
just_headers && export CC=true |
69 |
just_headers && export CC=true |
Lines 86-94
Link Here
|
86 |
LDFLAGS="${LDFLAGS}" \ |
91 |
LDFLAGS="${LDFLAGS}" \ |
87 |
VPATH="${DISTDIR}" |
92 |
VPATH="${DISTDIR}" |
88 |
fi |
93 |
fi |
|
|
94 |
|
95 |
# Create a static library for use with GCC fstack-protector calls |
96 |
# On certain architectures gcc emits a locally defined symbol that needs linking into target app |
97 |
$(tc-getCC) ${CFLAGS} -c "${T}"/__stack_chk_fail_local.c -o "${T}"/__stack_chk_fail_local.o |
98 |
$(tc-getAR) r "${T}"/libssp_nonshared.a "${T}"/__stack_chk_fail_local.o |
89 |
} |
99 |
} |
90 |
src_install() { |
100 |
src_install() { |
|
|
101 |
# Avoid breakage while swapping symlink and lib |
102 |
if [ -h ${sysroot}/lib/ld-musl-* ]; then |
103 |
local ldso=$(basename ${sysroot}/lib/ld-musl-*) |
104 |
eerror "***********************************************************************************" |
105 |
eerror "Warning: Reach carefully! Breakage possible!" |
106 |
eerror "In order to do the switcheroo and swap libc location, some manual changes are needed:" |
107 |
eerror "Manual upgrade needed. run:" |
108 |
einfo "cp --remove-destination ${sysroot}/usr/lib/libc.so ${sysroot}/lib/${ldso}" |
109 |
eerror "***********************************************************************************" |
110 |
die |
111 |
fi |
112 |
|
91 |
local target="install" |
113 |
local target="install" |
92 |
just_headers && target="install-headers" |
114 |
just_headers && target="install-headers" |
93 |
emake DESTDIR="${D}" ${target} |
115 |
emake DESTDIR="${D}" ${target} |
Lines 110-116
Link Here
|
110 |
cp "${FILESDIR}"/ldconfig.in "${T}" || die |
132 |
cp "${FILESDIR}"/ldconfig.in "${T}" || die |
111 |
sed -e "s|@@ARCH@@|${arch}|" "${T}"/ldconfig.in > "${T}"/ldconfig || die |
133 |
sed -e "s|@@ARCH@@|${arch}|" "${T}"/ldconfig.in > "${T}"/ldconfig || die |
112 |
into / |
134 |
into / |
113 |
dosbin "${T}"/ldconfig |
135 |
dosbin "${T}"/ldconfig |
114 |
into /usr |
136 |
into /usr |
115 |
dobin "${T}"/getconf |
137 |
dobin "${T}"/getconf |
116 |
dobin "${T}"/getent |
138 |
dobin "${T}"/getent |
Lines 118-123
Link Here
|
118 |
echo 'LDPATH="include ld.so.conf.d/*.conf"' > "${T}"/00musl || die |
140 |
echo 'LDPATH="include ld.so.conf.d/*.conf"' > "${T}"/00musl || die |
119 |
doenvd "${T}"/00musl |
141 |
doenvd "${T}"/00musl |
120 |
fi |
142 |
fi |
|
|
143 |
|
144 |
# Conditionally upgrade /usr/lib/libc.so into a linker script. Useful on x86 |
145 |
write_libc_so |
146 |
} |
147 |
|
148 |
write_libc_so() { |
149 |
if [ -e "${sysroot}"/lib/ld-musl-i386.so.1 ]; then |
150 |
rm ${D}/usr/lib/libc.so |
151 |
insinto /usr/lib |
152 |
insopts -m644 |
153 |
newins ${FILESDIR}/libc-so-i386.so libc.so |
154 |
fi |
121 |
} |
155 |
} |
122 |
pkg_postinst() { |
156 |
pkg_postinst() { |