From beb4a5f76fb37aae9642239c64c9922935ccb245 Mon Sep 17 00:00:00 2001 From: Ilya Palachev Date: Fri, 5 Dec 2014 15:25:09 +0300 Subject: [PATCH] Enable Gold linker for cross-*-binutils build Change-Id: I52f1fb61ac0c34153e0c50d1859a764de68bb285 Signed-off-by: Ilya Palachev --- packaging/binutils.spec | 27 ++++++++++++++++++++------- packaging/cross-aarch64-binutils.spec | 27 ++++++++++++++++++++------- packaging/cross-arm-binutils.spec | 27 ++++++++++++++++++++------- packaging/cross-i386-binutils.spec | 27 ++++++++++++++++++++------- packaging/cross-x86_64-binutils.spec | 27 ++++++++++++++++++++------- 5 files changed, 100 insertions(+), 35 deletions(-) diff --git a/packaging/binutils.spec b/packaging/binutils.spec index 2d0c59a..6b8093f 100644 --- a/packaging/binutils.spec +++ b/packaging/binutils.spec @@ -61,10 +61,8 @@ to compile a program or kernel. Summary: The gold linker License: GPL-3.0+ Group: Development/Building -Requires: binutils = %{version}-%{release} -%if 0%{!?cross:1} +Requires: %{name} = %{version}-%{release} %define gold_archs %ix86 %arm aarch64 x86_64 ppc ppc64 %sparc -%endif %description gold gold is an ELF linker. It is intended to have complete support for ELF @@ -210,6 +208,10 @@ TARGET_OS=%{TARGET}-tizen-linux %endif %endif ../configure CFLAGS="${RPM_OPT_FLAGS}" \ + --enable-plugins \ +%ifarch %gold_archs + --enable-gold \ +%endif --prefix=%{_prefix} \ --with-bugurl=http://bugs.opensuse.org/ \ --with-pkgversion="GNU Binutils; %{DIST}" \ @@ -251,6 +253,7 @@ cd build-dir make DESTDIR=$RPM_BUILD_ROOT install-gold ln -sf ld.gold $RPM_BUILD_ROOT%{_bindir}/gold %endif + make DESTDIR=$RPM_BUILD_ROOT install-info install make -C gas/doc DESTDIR=$RPM_BUILD_ROOT install-info-am install-am make DESTDIR=$RPM_BUILD_ROOT install-bfd install-opcodes @@ -266,6 +269,9 @@ ln -s "%_sysconfdir/alternatives/ld" "%buildroot/%_bindir/ld"; rm -rf $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin mkdir -p $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin ln -sf ../../bin/{ar,as,ld,nm,ranlib,strip} $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin +%ifarch %gold_archs +ln -sf ../../bin/ld.gold $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin +%endif mv $RPM_BUILD_ROOT%{_prefix}/%{HOST}/lib/ldscripts $RPM_BUILD_ROOT%{_libdir} ln -sf ../../%{_lib}/ldscripts $RPM_BUILD_ROOT%{_prefix}/%{HOST}/lib/ldscripts @@ -352,8 +358,7 @@ fi; %{_libdir}/ldscripts %{_bindir}/* %ifarch %gold_archs -%exclude %{_bindir}/gold -%exclude %{_bindir}/ld.gold +%exclude %{_bindir}/*gold %endif %doc %{_infodir}/*.gz %{_libdir}/lib*-%{version}*.so @@ -366,8 +371,16 @@ fi; %files gold %manifest %{name}.manifest %defattr(-,root,root) -%{_bindir}/gold -%{_bindir}/ld.gold +%{_bindir}/*gold +%if 0%{?cross:1} +%if "%{TARGET}" == "arm" +%{_prefix}/%{TARGET}-tizen-linux-gnueabi/bin/*gold +%else +%{_prefix}/%{TARGET}-tizen-linux/bin/*gold +%endif +%else +%{_prefix}/%{HOST}/bin/*gold +%endif %endif %if 0%{!?cross:1} diff --git a/packaging/cross-aarch64-binutils.spec b/packaging/cross-aarch64-binutils.spec index 4f48240..43d0e64 100644 --- a/packaging/cross-aarch64-binutils.spec +++ b/packaging/cross-aarch64-binutils.spec @@ -63,10 +63,8 @@ to compile a program or kernel. Summary: The gold linker License: GPL-3.0+ Group: Development/Building -Requires: binutils = %{version}-%{release} -%if 0%{!?cross:1} +Requires: %{name} = %{version}-%{release} %define gold_archs %ix86 %arm aarch64 x86_64 ppc ppc64 %sparc -%endif %description gold gold is an ELF linker. It is intended to have complete support for ELF @@ -211,6 +209,10 @@ TARGET_OS=%{TARGET}-tizen-linux %endif %endif ../configure CFLAGS="${RPM_OPT_FLAGS}" \ + --enable-plugins \ +%ifarch %gold_archs + --enable-gold \ +%endif --prefix=%{_prefix} \ --with-bugurl=http://bugs.opensuse.org/ \ --with-pkgversion="GNU Binutils; %{DIST}" \ @@ -252,6 +254,7 @@ cd build-dir make DESTDIR=$RPM_BUILD_ROOT install-gold ln -sf ld.gold $RPM_BUILD_ROOT%{_bindir}/gold %endif + make DESTDIR=$RPM_BUILD_ROOT install-info install make -C gas/doc DESTDIR=$RPM_BUILD_ROOT install-info-am install-am make DESTDIR=$RPM_BUILD_ROOT install-bfd install-opcodes @@ -267,6 +270,9 @@ ln -s "%_sysconfdir/alternatives/ld" "%buildroot/%_bindir/ld"; rm -rf $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin mkdir -p $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin ln -sf ../../bin/{ar,as,ld,nm,ranlib,strip} $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin +%ifarch %gold_archs +ln -sf ../../bin/ld.gold $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin +%endif mv $RPM_BUILD_ROOT%{_prefix}/%{HOST}/lib/ldscripts $RPM_BUILD_ROOT%{_libdir} ln -sf ../../%{_lib}/ldscripts $RPM_BUILD_ROOT%{_prefix}/%{HOST}/lib/ldscripts @@ -352,8 +358,7 @@ fi; %{_libdir}/ldscripts %{_bindir}/* %ifarch %gold_archs -%exclude %{_bindir}/gold -%exclude %{_bindir}/ld.gold +%exclude %{_bindir}/*gold %endif %doc %{_infodir}/*.gz %{_libdir}/lib*-%{version}*.so @@ -365,8 +370,16 @@ fi; %ifarch %gold_archs %files gold %defattr(-,root,root) -%{_bindir}/gold -%{_bindir}/ld.gold +%{_bindir}/*gold +%if 0%{?cross:1} +%if "%{TARGET}" == "arm" +%{_prefix}/%{TARGET}-tizen-linux-gnueabi/bin/*gold +%else +%{_prefix}/%{TARGET}-tizen-linux/bin/*gold +%endif +%else +%{_prefix}/%{HOST}/bin/*gold +%endif %endif %if 0%{!?cross:1} diff --git a/packaging/cross-arm-binutils.spec b/packaging/cross-arm-binutils.spec index 0bde260..c9887a3 100644 --- a/packaging/cross-arm-binutils.spec +++ b/packaging/cross-arm-binutils.spec @@ -63,10 +63,8 @@ to compile a program or kernel. Summary: The gold linker License: GPL-3.0+ Group: Development/Building -Requires: binutils = %{version}-%{release} -%if 0%{!?cross:1} +Requires: %{name} = %{version}-%{release} %define gold_archs %ix86 %arm aarch64 x86_64 ppc ppc64 %sparc -%endif %description gold gold is an ELF linker. It is intended to have complete support for ELF @@ -211,6 +209,10 @@ TARGET_OS=%{TARGET}-tizen-linux %endif %endif ../configure CFLAGS="${RPM_OPT_FLAGS}" \ + --enable-plugins \ +%ifarch %gold_archs + --enable-gold \ +%endif --prefix=%{_prefix} \ --with-bugurl=http://bugs.opensuse.org/ \ --with-pkgversion="GNU Binutils; %{DIST}" \ @@ -252,6 +254,7 @@ cd build-dir make DESTDIR=$RPM_BUILD_ROOT install-gold ln -sf ld.gold $RPM_BUILD_ROOT%{_bindir}/gold %endif + make DESTDIR=$RPM_BUILD_ROOT install-info install make -C gas/doc DESTDIR=$RPM_BUILD_ROOT install-info-am install-am make DESTDIR=$RPM_BUILD_ROOT install-bfd install-opcodes @@ -267,6 +270,9 @@ ln -s "%_sysconfdir/alternatives/ld" "%buildroot/%_bindir/ld"; rm -rf $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin mkdir -p $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin ln -sf ../../bin/{ar,as,ld,nm,ranlib,strip} $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin +%ifarch %gold_archs +ln -sf ../../bin/ld.gold $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin +%endif mv $RPM_BUILD_ROOT%{_prefix}/%{HOST}/lib/ldscripts $RPM_BUILD_ROOT%{_libdir} ln -sf ../../%{_lib}/ldscripts $RPM_BUILD_ROOT%{_prefix}/%{HOST}/lib/ldscripts @@ -352,8 +358,7 @@ fi; %{_libdir}/ldscripts %{_bindir}/* %ifarch %gold_archs -%exclude %{_bindir}/gold -%exclude %{_bindir}/ld.gold +%exclude %{_bindir}/*gold %endif %doc %{_infodir}/*.gz %{_libdir}/lib*-%{version}*.so @@ -365,8 +370,16 @@ fi; %ifarch %gold_archs %files gold %defattr(-,root,root) -%{_bindir}/gold -%{_bindir}/ld.gold +%{_bindir}/*gold +%if 0%{?cross:1} +%if "%{TARGET}" == "arm" +%{_prefix}/%{TARGET}-tizen-linux-gnueabi/bin/*gold +%else +%{_prefix}/%{TARGET}-tizen-linux/bin/*gold +%endif +%else +%{_prefix}/%{HOST}/bin/*gold +%endif %endif %if 0%{!?cross:1} diff --git a/packaging/cross-i386-binutils.spec b/packaging/cross-i386-binutils.spec index e25e0f3..9f68dab 100644 --- a/packaging/cross-i386-binutils.spec +++ b/packaging/cross-i386-binutils.spec @@ -63,10 +63,8 @@ to compile a program or kernel. Summary: The gold linker License: GPL-3.0+ Group: Development/Building -Requires: binutils = %{version}-%{release} -%if 0%{!?cross:1} +Requires: %{name} = %{version}-%{release} %define gold_archs %ix86 %arm aarch64 x86_64 ppc ppc64 %sparc -%endif %description gold gold is an ELF linker. It is intended to have complete support for ELF @@ -211,6 +209,10 @@ TARGET_OS=%{TARGET}-tizen-linux %endif %endif ../configure CFLAGS="${RPM_OPT_FLAGS}" \ + --enable-plugins \ +%ifarch %gold_archs + --enable-gold \ +%endif --prefix=%{_prefix} \ --with-bugurl=http://bugs.opensuse.org/ \ --with-pkgversion="GNU Binutils; %{DIST}" \ @@ -252,6 +254,7 @@ cd build-dir make DESTDIR=$RPM_BUILD_ROOT install-gold ln -sf ld.gold $RPM_BUILD_ROOT%{_bindir}/gold %endif + make DESTDIR=$RPM_BUILD_ROOT install-info install make -C gas/doc DESTDIR=$RPM_BUILD_ROOT install-info-am install-am make DESTDIR=$RPM_BUILD_ROOT install-bfd install-opcodes @@ -267,6 +270,9 @@ ln -s "%_sysconfdir/alternatives/ld" "%buildroot/%_bindir/ld"; rm -rf $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin mkdir -p $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin ln -sf ../../bin/{ar,as,ld,nm,ranlib,strip} $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin +%ifarch %gold_archs +ln -sf ../../bin/ld.gold $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin +%endif mv $RPM_BUILD_ROOT%{_prefix}/%{HOST}/lib/ldscripts $RPM_BUILD_ROOT%{_libdir} ln -sf ../../%{_lib}/ldscripts $RPM_BUILD_ROOT%{_prefix}/%{HOST}/lib/ldscripts @@ -352,8 +358,7 @@ fi; %{_libdir}/ldscripts %{_bindir}/* %ifarch %gold_archs -%exclude %{_bindir}/gold -%exclude %{_bindir}/ld.gold +%exclude %{_bindir}/*gold %endif %doc %{_infodir}/*.gz %{_libdir}/lib*-%{version}*.so @@ -365,8 +370,16 @@ fi; %ifarch %gold_archs %files gold %defattr(-,root,root) -%{_bindir}/gold -%{_bindir}/ld.gold +%{_bindir}/*gold +%if 0%{?cross:1} +%if "%{TARGET}" == "arm" +%{_prefix}/%{TARGET}-tizen-linux-gnueabi/bin/*gold +%else +%{_prefix}/%{TARGET}-tizen-linux/bin/*gold +%endif +%else +%{_prefix}/%{HOST}/bin/*gold +%endif %endif %if 0%{!?cross:1} diff --git a/packaging/cross-x86_64-binutils.spec b/packaging/cross-x86_64-binutils.spec index f4741c5..df3743b 100644 --- a/packaging/cross-x86_64-binutils.spec +++ b/packaging/cross-x86_64-binutils.spec @@ -63,10 +63,8 @@ to compile a program or kernel. Summary: The gold linker License: GPL-3.0+ Group: Development/Building -Requires: binutils = %{version}-%{release} -%if 0%{!?cross:1} +Requires: %{name} = %{version}-%{release} %define gold_archs %ix86 %arm aarch64 x86_64 ppc ppc64 %sparc -%endif %description gold gold is an ELF linker. It is intended to have complete support for ELF @@ -211,6 +209,10 @@ TARGET_OS=%{TARGET}-tizen-linux %endif %endif ../configure CFLAGS="${RPM_OPT_FLAGS}" \ + --enable-plugins \ +%ifarch %gold_archs + --enable-gold \ +%endif --prefix=%{_prefix} \ --with-bugurl=http://bugs.opensuse.org/ \ --with-pkgversion="GNU Binutils; %{DIST}" \ @@ -252,6 +254,7 @@ cd build-dir make DESTDIR=$RPM_BUILD_ROOT install-gold ln -sf ld.gold $RPM_BUILD_ROOT%{_bindir}/gold %endif + make DESTDIR=$RPM_BUILD_ROOT install-info install make -C gas/doc DESTDIR=$RPM_BUILD_ROOT install-info-am install-am make DESTDIR=$RPM_BUILD_ROOT install-bfd install-opcodes @@ -267,6 +270,9 @@ ln -s "%_sysconfdir/alternatives/ld" "%buildroot/%_bindir/ld"; rm -rf $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin mkdir -p $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin ln -sf ../../bin/{ar,as,ld,nm,ranlib,strip} $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin +%ifarch %gold_archs +ln -sf ../../bin/ld.gold $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin +%endif mv $RPM_BUILD_ROOT%{_prefix}/%{HOST}/lib/ldscripts $RPM_BUILD_ROOT%{_libdir} ln -sf ../../%{_lib}/ldscripts $RPM_BUILD_ROOT%{_prefix}/%{HOST}/lib/ldscripts @@ -352,8 +358,7 @@ fi; %{_libdir}/ldscripts %{_bindir}/* %ifarch %gold_archs -%exclude %{_bindir}/gold -%exclude %{_bindir}/ld.gold +%exclude %{_bindir}/*gold %endif %doc %{_infodir}/*.gz %{_libdir}/lib*-%{version}*.so @@ -365,8 +370,16 @@ fi; %ifarch %gold_archs %files gold %defattr(-,root,root) -%{_bindir}/gold -%{_bindir}/ld.gold +%{_bindir}/*gold +%if 0%{?cross:1} +%if "%{TARGET}" == "arm" +%{_prefix}/%{TARGET}-tizen-linux-gnueabi/bin/*gold +%else +%{_prefix}/%{TARGET}-tizen-linux/bin/*gold +%endif +%else +%{_prefix}/%{HOST}/bin/*gold +%endif %endif %if 0%{!?cross:1} -- 2.7.4