Enable Gold linker for cross-*-binutils build
authorIlya Palachev <i.palachev@samsung.com>
Fri, 5 Dec 2014 12:25:09 +0000 (15:25 +0300)
committerVyacheslav Barinov <v.barinov@samsung.com>
Mon, 16 Feb 2015 07:34:10 +0000 (10:34 +0300)
Change-Id: I52f1fb61ac0c34153e0c50d1859a764de68bb285
Signed-off-by: Ilya Palachev <i.palachev@samsung.com>
packaging/binutils.spec
packaging/cross-aarch64-binutils.spec
packaging/cross-arm-binutils.spec
packaging/cross-i386-binutils.spec
packaging/cross-x86_64-binutils.spec

index 2d0c59a..6b8093f 100644 (file)
@@ -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}
index 4f48240..43d0e64 100644 (file)
@@ -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}
index 0bde260..c9887a3 100644 (file)
@@ -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}
index e25e0f3..9f68dab 100644 (file)
@@ -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}
index f4741c5..df3743b 100644 (file)
@@ -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}