From: Mikhail Kashkarov Date: Thu, 11 May 2017 09:14:51 +0000 (+0300) Subject: Add armv7hl support. X-Git-Tag: submit/tizen_base/20171024.003248^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0dd3bc431de697efebd13b71d98bace6311d62c0;p=external%2Fbinutils.git Add armv7hl support. Change-Id: I1abc28bf90731946353b86579e85bd391c1745d3 --- diff --git a/packaging/binutils-aarch64.spec b/packaging/binutils-aarch64.spec index ea628b8..059ddf4 100644 --- a/packaging/binutils-aarch64.spec +++ b/packaging/binutils-aarch64.spec @@ -5,6 +5,10 @@ %define ARCH armv7l %define ABI eabi %endif +%ifarch armv7hl +%define ARCH armv7hl +%define ABI eabihf +%endif %ifarch %ix86 %define ARCH i586 %endif @@ -18,7 +22,7 @@ %define host_arch %{ARCH}-tizen-linux-gnu%{?ABI} %define target_cpu %{?cross}%{!?cross:%{ARCH}} -%define target_abi %{?cross:%{?armv7l:eabi}}%{!?cross:%{?ABI}} +%define target_abi %{?cross:%{?armv7l:eabi}%{?armv7hl:eabihf}}%{!?cross:%{?ABI}} %define target_arch %{target_cpu}-tizen-linux-gnu%{?target_abi} @@ -96,7 +100,7 @@ cd build-dir --enable-64-bit-bfd \ } \ %{!?cross: \ - --enable-targets=aarch64-tizen-linux,armv7l-tizen-linux,armv8l-tizen-linux,i686-tizen-linux,x86_64-tizen-linux \ + --enable-targets=aarch64-tizen-linux,armv7l-tizen-linux,armv7hl-tizen-linux,armv8l-tizen-linux,i686-tizen-linux,x86_64-tizen-linux \ } \ --enable-plugins \ --enable-gold \ diff --git a/packaging/binutils-armv7hl.spec b/packaging/binutils-armv7hl.spec new file mode 100644 index 0000000..4bbe3aa --- /dev/null +++ b/packaging/binutils-armv7hl.spec @@ -0,0 +1,170 @@ +%define cross armv7hl +%define armv7hl 1 + +%ifarch armv7l +%define ARCH armv7l +%define ABI eabi +%endif +%ifarch armv7hl +%define ARCH armv7hl +%define ABI eabihf +%endif +%ifarch %ix86 +%define ARCH i586 +%endif +%ifarch x86_64 +%define ARCH x86_64 +%endif +%ifarch aarch64 +%define ARCH aarch64 +%endif + +%define host_arch %{ARCH}-tizen-linux-gnu%{?ABI} + +%define target_cpu %{?cross}%{!?cross:%{ARCH}} +%define target_abi %{?cross:%{?armv7l:eabi}%{?armv7hl:eabihf}}%{!?cross:%{?ABI}} + +%define target_arch %{target_cpu}-tizen-linux-gnu%{?target_abi} + +Name: binutils%{?cross:-%{cross}} +BuildRequires: makeinfo +BuildRequires: bison +BuildRequires: flex +BuildRequires: ncurses-devel +BuildRequires: zlib-devel +BuildRequires: gcc-c++ +Version: 2.27 +Release: 0 +Url: http://www.gnu.org/software/binutils/ +Summary: GNU Binutils +License: GFDL-1.3 and GPL-3.0+ +Group: Development/Building +%{?cross:ExcludeArch: %{cross}} +Source: binutils-%{version}.tar.bz2 +Source1001: binutils.manifest + +%description +C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, +size, strings, and strip. These utilities are needed whenever you want +to compile a program or kernel. + + +%package gold +Summary: The gold linker +License: GPL-3.0+ +Group: Development/Building + +%description gold +gold is an ELF linker. It is intended to have complete support for ELF +and to run as fast as possible on modern systems. For normal use it is +a drop-in replacement for the older GNU linker. + + +%package devel +Summary: GNU binutils (BFD development files) +License: GPL-3.0+ +Group: Development/Building +Requires: zlib-devel + +%description devel +This package includes header files and static libraries necessary to +build programs which use the GNU BFD library, which is part of +binutils. + + +%prep +%setup -q -n binutils-%{version} +cp %{SOURCE1001} . + + +%build +RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error %{?cross:-DIGNORE_BROKEN_PLUGINS}" +export CFLAGS="${RPM_OPT_FLAGS}" +export CXXFLAGS="${RPM_OPT_FLAGS}" + +mkdir build-dir +cd build-dir + +../configure \ + --prefix=%{_prefix} --libdir=%{_libdir} \ + --infodir=%{_infodir} --mandir=%{_mandir} \ + --with-bugurl=http://bugs.tizen.org/ \ + --with-sysroot=/ \ + --disable-nls \ + --with-separate-debug-dir=%{_prefix}/lib/debug \ + --with-pic \ + --build=%{host_arch} --target=%{target_arch} \ + --host=%{host_arch} \ +%{?cross: \ + --enable-targets=%{target_arch} \ + --enable-64-bit-bfd \ +} \ +%{!?cross: \ + --enable-targets=aarch64-tizen-linux,armv7l-tizen-linux,armv7hl-tizen-linux,armv8l-tizen-linux,i686-tizen-linux,x86_64-tizen-linux \ +} \ + --enable-plugins \ + --enable-gold \ + --enable-shared \ + --enable-new-dtags + +make %{?_smp_mflags} + +%install +cd build-dir +make DESTDIR=$RPM_BUILD_ROOT install + +# Copy instead of hardlinks +for binary in ar as ld{,.bfd,.gold} nm obj{dump,copy} ranlib strip +do + rm %{buildroot}%{_prefix}/%{target_arch}/bin/$binary +%{!?cross: + cp %{buildroot}%{_bindir}/$binary %{buildroot}%{_prefix}/%{target_arch}/bin/$binary +} +%{?cross: + cp %{buildroot}%{_bindir}/%{target_arch}-$binary %{buildroot}%{_prefix}/%{target_arch}/bin/$binary +} +done + +install -m 644 libiberty/pic/libiberty.a %{buildroot}%{_prefix}/%{_lib} +install -m 644 ../include/libiberty.h %{buildroot}%{_prefix}/include + +# Remove unwanted files to shut up rpm +%{remove_docs} +rm -rf %{buildroot}%{_bindir}/gcore +rm -rf %{buildroot}%{_bindir}/gdb* +rm -rf %{buildroot}%{_datadir}/gdb +rm -rf %{buildroot}%{_libdir}/lib{bfd,opcodes,inproctrace}.{so,la} +%{?cross: +rm -rf %{buildroot}%{_prefix}/%{target_arch}/lib/ldscripts +rm -rf %{buildroot}%{_prefix}/%{host_arch} +rm -rf %{buildroot}%{_includedir} +rm -rf %{buildroot}%{_prefix}/lib* +rm -rf %{buildroot}%{_datadir} +} + +%files +%manifest binutils.manifest +%defattr(-,root,root) +%{_bindir}/* +%{_prefix}/%{target_arch}/bin/* +%{!?cross: +%exclude %{_bindir}/ld.gold +%exclude %{_prefix}/%{target_arch}/bin/ld.gold +%{_libdir}/*.so +%{_prefix}/%{host_arch}/lib/ldscripts + +%files devel +%manifest binutils.manifest +%defattr(-,root,root) +%{_includedir}/*.h +%{_includedir}/gdb/*.h +%{_libdir}/*.a + +%files gold +%manifest binutils.manifest +%defattr(-,root,root) +%{_bindir}/ld.gold +%{_prefix}/%{target_arch}/bin/ld.gold +} + +%changelog diff --git a/packaging/binutils-armv7l.spec b/packaging/binutils-armv7l.spec index 6ef2038..f7d99d5 100644 --- a/packaging/binutils-armv7l.spec +++ b/packaging/binutils-armv7l.spec @@ -5,6 +5,10 @@ %define ARCH armv7l %define ABI eabi %endif +%ifarch armv7hl +%define ARCH armv7hl +%define ABI eabihf +%endif %ifarch %ix86 %define ARCH i586 %endif @@ -18,7 +22,7 @@ %define host_arch %{ARCH}-tizen-linux-gnu%{?ABI} %define target_cpu %{?cross}%{!?cross:%{ARCH}} -%define target_abi %{?cross:%{?armv7l:eabi}}%{!?cross:%{?ABI}} +%define target_abi %{?cross:%{?armv7l:eabi}%{?armv7hl:eabihf}}%{!?cross:%{?ABI}} %define target_arch %{target_cpu}-tizen-linux-gnu%{?target_abi} @@ -96,7 +100,7 @@ cd build-dir --enable-64-bit-bfd \ } \ %{!?cross: \ - --enable-targets=aarch64-tizen-linux,armv7l-tizen-linux,armv8l-tizen-linux,i686-tizen-linux,x86_64-tizen-linux \ + --enable-targets=aarch64-tizen-linux,armv7l-tizen-linux,armv7hl-tizen-linux,armv8l-tizen-linux,i686-tizen-linux,x86_64-tizen-linux \ } \ --enable-plugins \ --enable-gold \ diff --git a/packaging/binutils.spec b/packaging/binutils.spec index b6826cc..96c4d55 100644 --- a/packaging/binutils.spec +++ b/packaging/binutils.spec @@ -2,6 +2,10 @@ %define ARCH armv7l %define ABI eabi %endif +%ifarch armv7hl +%define ARCH armv7hl +%define ABI eabihf +%endif %ifarch %ix86 %define ARCH i586 %endif @@ -15,7 +19,7 @@ %define host_arch %{ARCH}-tizen-linux-gnu%{?ABI} %define target_cpu %{?cross}%{!?cross:%{ARCH}} -%define target_abi %{?cross:%{?armv7l:eabi}}%{!?cross:%{?ABI}} +%define target_abi %{?cross:%{?armv7l:eabi}%{?armv7hl:eabihf}}%{!?cross:%{?ABI}} %define target_arch %{target_cpu}-tizen-linux-gnu%{?target_abi} @@ -93,7 +97,7 @@ cd build-dir --enable-64-bit-bfd \ } \ %{!?cross: \ - --enable-targets=aarch64-tizen-linux,armv7l-tizen-linux,armv8l-tizen-linux,i686-tizen-linux,x86_64-tizen-linux \ + --enable-targets=aarch64-tizen-linux,armv7l-tizen-linux,armv7hl-tizen-linux,armv8l-tizen-linux,i686-tizen-linux,x86_64-tizen-linux \ } \ --enable-plugins \ --enable-gold \ diff --git a/packaging/pre_checkin.sh b/packaging/pre_checkin.sh index 68e6483..1134ae7 100755 --- a/packaging/pre_checkin.sh +++ b/packaging/pre_checkin.sh @@ -2,7 +2,7 @@ # the script takes binutils* and creates the cross-* packages # sh4 is stuck in the testsuite -for arch in armv7l aarch64; do +for arch in armv7l armv7hl aarch64; do echo -n "Building package for $arch --> binutils-$arch ..."