linux*: misc fixes to allow musl builds.

This commit is contained in:
Juan RP 2014-11-10 18:12:58 +01:00
parent 6d2d3fe993
commit 6749cdc08a
5 changed files with 75 additions and 59 deletions

View File

@ -9,7 +9,7 @@ update_site="https://www.kernel.org/feeds/kdist.xml"
update_pattern="<title>\K\d+.\d+(?=.[\d]+: stable</title>)"
maintainer="Juan RP <xtraeme@gmail.com>"
license="Public domain"
only_for_archs="i686 x86_64"
only_for_archs="i686 i686-musl x86_64 x86_64-musl"
case "$XBPS_TARGET_MACHINE" in
i686*|x86_64*)

View File

@ -16,8 +16,8 @@ _kernver="${version}_${revision}"
nostrip=yes
noverifyrdeps=yes
preserve=yes
only_for_archs="i686 x86_64"
makedepends="bc perl kmod>=11_2 libressl-openssl elfutils"
only_for_archs="i686 i686-musl x86_64 x86_64-musl"
makedepends="bc perl kmod>=11_2 libressl-openssl"
triggers="kernel-hooks"
# These files could be modified when an external module is built.
mutable_files="
@ -35,11 +35,10 @@ do_configure() {
# as modules (defconfig+allmodconfig).
local arch
if [ "$XBPS_TARGET_MACHINE" != "x86_64" ]; then
arch=i386
else
arch=x86_64
fi
case "$XBPS_TARGET_MACHINE" in
i686*) arch=i386;;
x86_64*) arch=x86_64;;
esac
if [ -f ${FILESDIR}/${arch}-dotconfig-custom ]; then
msg_normal "Detected a custom .config file for your arch, using it.\n"
@ -56,21 +55,26 @@ do_configure() {
fi
# Always use our revision to CONFIG_LOCALVERSION to match our pkg version.
sed -i -e "s|^\(CONFIG_LOCALVERSION=\).*|\1\"_${revision}\"|" .config
}
# XXX disable -fstack-protector-strong with musl; remove this if gcc>=4.9
# is supported with musl.
case "$XBPS_TARGET_MACHINE" in
*-musl)
sed -i -e 's|\(CONFIG_CC_STACKPROTECTOR_STRONG\).*|# \1 is not set|' .config
;;
esac
}
do_build() {
make ${makejobs} prepare
make ${makejobs} bzImage modules
}
do_install() {
local arch hdrdest
if [ "$XBPS_TARGET_MACHINE" != "x86_64" ]; then
arch=i386
else
arch=x86_64
fi
case "$XBPS_TARGET_MACHINE" in
i686*) arch=i386;;
x86_64*) arch=x86_64;;
esac
# Run depmod after compressing modules.
sed -i '2iexit 0' scripts/depmod.sh

View File

@ -16,8 +16,8 @@ _kernver="${version}_${revision}"
nostrip=yes
noverifyrdeps=yes
preserve=yes
only_for_archs="i686 x86_64"
makedepends="bc perl kmod>=11_2 libressl-openssl elfutils"
only_for_archs="i686 i686-musl x86_64 x86_64-musl"
makedepends="bc perl kmod>=11_2 libressl-openssl"
triggers="kernel-hooks"
# These files could be modified when an external module is built.
mutable_files="
@ -35,11 +35,10 @@ do_configure() {
# as modules (defconfig+allmodconfig).
local arch
if [ "$XBPS_TARGET_MACHINE" != "x86_64" ]; then
arch=i386
else
arch=x86_64
fi
case "$XBPS_TARGET_MACHINE" in
i686*) arch=i386;;
x86_64*) arch=x86_64;;
esac
if [ -f ${FILESDIR}/${arch}-dotconfig-custom ]; then
msg_normal "Detected a custom .config file for your arch, using it.\n"
@ -56,22 +55,27 @@ do_configure() {
fi
# Always use our revision to CONFIG_LOCALVERSION to match our pkg version.
sed -i -e "s|^\(CONFIG_LOCALVERSION=\).*|\1\"_${revision}\"|" .config
}
# XXX disable -fstack-protector-strong with musl; remove this if gcc>=4.9
# is supported with musl.
case "$XBPS_TARGET_MACHINE" in
*-musl)
sed -i -e 's|\(CONFIG_CC_STACKPROTECTOR_STRONG\).*|# \1 is not set|' .config
;;
esac
}
do_build() {
# Override EXTRAVERSION because we can't have dashes in kernel name
# Override EXTRAVERSION because we can't have dashes in kernel name
make EXTRAVERSION=${_patchver} ${makejobs} prepare
make EXTRAVERSION=${_patchver} ${makejobs} bzImage modules
}
do_install() {
local arch hdrdest
if [ "$XBPS_TARGET_MACHINE" != "x86_64" ]; then
arch=i386
else
arch=x86_64
fi
case "$XBPS_TARGET_MACHINE" in
i686*) arch=i386;;
x86_64*) arch=x86_64;;
esac
# Run depmod after compressing modules.
sed -i '2iexit 0' scripts/depmod.sh

View File

@ -16,8 +16,8 @@ _kernver="${version}_${revision}"
nostrip=yes
noverifyrdeps=yes
preserve=yes
only_for_archs="i686 x86_64"
makedepends="bc perl kmod>=11_2 libressl-openssl elfutils"
only_for_archs="i686 i686-musl x86_64 x86_64-musl"
makedepends="bc perl kmod>=11_2 libressl-openssl"
triggers="kernel-hooks"
# These files could be modified when an external module is built.
mutable_files="
@ -35,11 +35,10 @@ do_configure() {
# as modules (defconfig+allmodconfig).
local arch
if [ "$XBPS_TARGET_MACHINE" != "x86_64" ]; then
arch=i386
else
arch=x86_64
fi
case "$XBPS_TARGET_MACHINE" in
i686*) arch=i386;;
x86_64*) arch=x86_64;;
esac
if [ -f ${FILESDIR}/${arch}-dotconfig-custom ]; then
msg_normal "Detected a custom .config file for your arch, using it.\n"
@ -56,22 +55,27 @@ do_configure() {
fi
# Always use our revision to CONFIG_LOCALVERSION to match our pkg version.
sed -i -e "s|^\(CONFIG_LOCALVERSION=\).*|\1\"_${revision}\"|" .config
}
# XXX disable -fstack-protector-strong with musl; remove this if gcc>=4.9
# is supported with musl.
case "$XBPS_TARGET_MACHINE" in
*-musl)
sed -i -e 's|\(CONFIG_CC_STACKPROTECTOR_STRONG\).*|# \1 is not set|' .config
;;
esac
}
do_build() {
# Override EXTRAVERSION because we can't have dashes in kernel name
# Override EXTRAVERSION because we can't have dashes in kernel name
make EXTRAVERSION=${_patchver} ${makejobs} prepare
make EXTRAVERSION=${_patchver} ${makejobs} bzImage modules
}
do_install() {
local arch hdrdest
if [ "$XBPS_TARGET_MACHINE" != "x86_64" ]; then
arch=i386
else
arch=x86_64
fi
case "$XBPS_TARGET_MACHINE" in
i686*) arch=i386;;
x86_64*) arch=x86_64;;
esac
# Run depmod after compressing modules.
sed -i '2iexit 0' scripts/depmod.sh

View File

@ -18,8 +18,8 @@ _kernver="${version}_${revision}"
nostrip=yes
noverifyrdeps=yes
preserve=yes
only_for_archs="i686 x86_64"
makedepends="bc perl kmod>=11_2 libressl-openssl elfutils"
only_for_archs="i686 i686-musl x86_64 x86_64-musl"
makedepends="bc perl kmod>=11_2 libressl-openssl"
triggers="kernel-hooks"
# These files could be modified when an external module is built.
mutable_files="
@ -37,11 +37,10 @@ do_configure() {
# as modules (defconfig+allmodconfig).
local arch
if [ "$XBPS_TARGET_MACHINE" != "x86_64" ]; then
arch=i386
else
arch=x86_64
fi
case "$XBPS_TARGET_MACHINE" in
i686*) arch=i386;;
x86_64*) arch=x86_64;;
esac
if [ -f ${FILESDIR}/${arch}-dotconfig-custom ]; then
msg_normal "Detected a custom .config file for your arch, using it.\n"
@ -58,22 +57,27 @@ do_configure() {
fi
# Always use our revision to CONFIG_LOCALVERSION to match our pkg version.
sed -i -e "s|^\(CONFIG_LOCALVERSION=\).*|\1\"_${revision}\"|" .config
}
# XXX disable -fstack-protector-strong with musl; remove this if gcc>=4.9
# is supported with musl.
case "$XBPS_TARGET_MACHINE" in
*-musl)
sed -i -e 's|\(CONFIG_CC_STACKPROTECTOR_STRONG\).*|# \1 is not set|' .config
;;
esac
}
do_build() {
# Override EXTRAVERSION because we can't have dashes in kernel name
make EXTRAVERSION=${_patchver} ${makejobs} prepare
make EXTRAVERSION=${_patchver} ${makejobs} bzImage modules
}
do_install() {
local arch hdrdest
if [ "$XBPS_TARGET_MACHINE" != "x86_64" ]; then
arch=i386
else
arch=x86_64
fi
case "$XBPS_TARGET_MACHINE" in
i686*) arch=i386;;
x86_64*) arch=x86_64;;
esac
# Run depmod after compressing modules.
sed -i '2iexit 0' scripts/depmod.sh