Commit b870dd8c authored by Natanael Copa's avatar Natanael Copa

main/binutils: build --with-pic and --enable-shared

add --enable-shared unless we are making a cross compiler

shared libs reduces size

The --with-pic fixes the error: relocation R_X86_64_PC32 against symbol
`_bfd_std_section' can not be used when making a shared object;

Also modernize a bit while at it
parent d7f6298f
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=binutils
pkgver=2.30
pkgrel=3
pkgrel=4
pkgdesc="Tools necessary to build programs"
url="https://www.gnu.org/software/binutils/"
depends=""
......@@ -37,6 +37,8 @@ build() {
if [ "$CHOST" != "$CTARGET" ]; then
_sysroot="$CBUILDROOT"
_cross_configure="--disable-install-libiberty"
else
_cross_configure="--enable-shared"
fi
if [ "$CTARGET_ARCH" = "x86_64" ]; then
......@@ -68,16 +70,16 @@ build() {
$_cross_configure \
$_arch_configure \
$_hash_style_configure \
--with-pic \
--disable-werror \
--disable-nls \
--with-system-zlib \
|| return 1
make || return 1
--with-system-zlib
make
}
package() {
cd "$builddir"
make install DESTDIR="$pkgdir" || return 1
make install DESTDIR="$pkgdir"
if [ -d "$pkgdir"/usr/lib64 ]; then
mv "$pkgdir"/usr/lib64/* "$pkgdir"/usr/lib/
rmdir "$pkgdir"/usr/lib64
......@@ -94,7 +96,7 @@ libs() {
pkgdesc="Runtime libraries from binutils - libbfd and libopcodes"
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/lib*.so "$subpkgdir"/usr/lib/ || return 1
mv "$pkgdir"/usr/lib/lib*.so "$subpkgdir"/usr/lib/
}
gold() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment