Mon, 12 Jan 2009 14:38:36 +0100
Import package vendor original specs for necessary manipulations.
binutils/binutils.patch | file | annotate | diff | comparison | revisions | |
binutils/binutils.spec | file | annotate | diff | comparison | revisions |
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/binutils/binutils.patch Mon Jan 12 14:38:36 2009 +0100 1.3 @@ -0,0 +1,177 @@ 1.4 +Use the platform specific ELF branding expected under FreeBSD. 1.5 +This is similar to what the vendor ld(1) does on this platform. 1.6 + 1.7 +Additionally, recognize and ignore Solaris 10's "Solaris Cryptographic 1.8 +Framework" ELF header type "SUNW_signature", Solaris 10 "Symbol 1.9 +information" ELF header type "SUNW_syminfo" and Solaris 10 "DTrace 1.10 +Object Format" ELF header type. Also, fix the path to the dynamic 1.11 +linker under Solaris 10/amd64. 1.12 + 1.13 +Index: include/elf/common.h 1.14 +--- include/elf/common.h.orig 2007-08-28 19:19:40 +0200 1.15 ++++ include/elf/common.h 2007-08-29 09:30:04 +0200 1.16 +@@ -353,6 +353,9 @@ 1.17 + #define SHT_SUNW_verdef 0x6ffffffd /* Versions defined by file */ 1.18 + #define SHT_SUNW_verneed 0x6ffffffe /* Versions needed by file */ 1.19 + #define SHT_SUNW_versym 0x6fffffff /* Symbol versions */ 1.20 ++#define SHT_SUNW_syminfo 0x6ffffffc /* Symbol information */ 1.21 ++#define SHT_SUNW_signature 0x6ffffff6 /* Solaris Cryptographic Framework: Digital Signature */ 1.22 ++#define SHT_SUNW_dof 0x6ffffff4 /* Solaris DTrace Object Format */ 1.23 + 1.24 + #define SHT_GNU_verdef SHT_SUNW_verdef 1.25 + #define SHT_GNU_verneed SHT_SUNW_verneed 1.26 +Index: bfd/elf.c 1.27 +--- bfd/elf.c.orig 2007-08-28 19:19:33 +0200 1.28 ++++ bfd/elf.c 2007-08-29 09:30:04 +0200 1.29 +@@ -1793,6 +1793,11 @@ 1.30 + elf_tdata (abfd)->dynverref_hdr = *hdr; 1.31 + return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); 1.32 + 1.33 ++ case SHT_SUNW_syminfo: 1.34 ++ /* case SHT_SUNW_signature: conflicts with new SHT_GNU_HASH in Binutils 2.18 */ 1.35 ++ case SHT_SUNW_dof: 1.36 ++ return TRUE; 1.37 ++ 1.38 + case SHT_SHLIB: 1.39 + return TRUE; 1.40 + 1.41 +@@ -4682,6 +4687,12 @@ 1.42 + else 1.43 + i_ehdrp->e_type = ET_REL; 1.44 + 1.45 ++ /* OpenPKG platform branding BEGIN */ 1.46 ++#if defined(OPENPKG_OS_FREEBSD) 1.47 ++ i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD; 1.48 ++#endif 1.49 ++ /* OpenPKG platform branding END */ 1.50 ++ 1.51 + switch (bfd_get_arch (abfd)) 1.52 + { 1.53 + case bfd_arch_unknown: 1.54 +Index: bfd/elf64-x86-64.c 1.55 +--- bfd/elf64-x86-64.c.orig 2007-08-06 21:59:33 +0200 1.56 ++++ bfd/elf64-x86-64.c 2007-08-29 09:30:04 +0200 1.57 +@@ -345,7 +345,11 @@ 1.58 + /* The name of the dynamic interpreter. This is put in the .interp 1.59 + section. */ 1.60 + 1.61 ++#if defined(OPENPKG_OS_SOLARIS) 1.62 ++#define ELF_DYNAMIC_INTERPRETER "/lib/amd64/ld.so.1" 1.63 ++#else 1.64 + #define ELF_DYNAMIC_INTERPRETER "/lib/ld64.so.1" 1.65 ++#endif 1.66 + 1.67 + /* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid 1.68 + copying dynamic variables from a shared lib into an app's dynbss 1.69 + 1.70 +----------------------------------------------------------------------------- 1.71 + 1.72 +Support FreeBSD >= 4.10 by fixing platform detection. 1.73 + 1.74 +Index: bfd/configure 1.75 +--- bfd/configure.orig 2007-08-28 22:19:51 +0200 1.76 ++++ bfd/configure 2007-08-29 09:30:04 +0200 1.77 +@@ -17459,6 +17459,10 @@ 1.78 + i[3-7]86-*-bsdi) 1.79 + COREFILE= 1.80 + ;; 1.81 ++ i[3456]86-*-freebsd4.1[0-9]*) 1.82 ++ COREFILE='' 1.83 ++ TRAD_HEADER='"hosts/i386bsd.h"' 1.84 ++ ;; 1.85 + i[3-7]86-*-bsd* | i[3-7]86-*-freebsd[123] | i[3-7]86-*-freebsd[123]\.* | i[3-7]86-*-freebsd4\.[01234] | i[3-7]86-*-freebsd4\.[01234]\.* | i[3-7]86-*-freebsd*aout*) 1.86 + COREFILE=trad-core.lo 1.87 + TRAD_HEADER='"hosts/i386bsd.h"' 1.88 + 1.89 +----------------------------------------------------------------------------- 1.90 + 1.91 +Fight problems with --disable-nls under Solaris 1.92 + 1.93 +Index: gas/asintl.h 1.94 +--- gas/asintl.h.orig 2007-08-06 21:59:49 +0200 1.95 ++++ gas/asintl.h 2007-08-29 09:30:04 +0200 1.96 +@@ -20,6 +20,11 @@ 1.97 + Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 1.98 + 02110-1301, USA. */ 1.99 + 1.100 ++#ifndef ENABLE_NLS 1.101 ++# define _LIBINTL_H 1.102 ++# define _LIBGETTEXT_H 1.103 ++#endif 1.104 ++ 1.105 + #ifdef HAVE_LOCALE_H 1.106 + # ifndef ENABLE_NLS 1.107 + /* The Solaris version of locale.h always includes libintl.h. If we have 1.108 +Index: ld/ld.h 1.109 +--- ld/ld.h.orig 2007-08-06 22:00:19 +0200 1.110 ++++ ld/ld.h 2007-08-29 09:30:04 +0200 1.111 +@@ -23,6 +23,11 @@ 1.112 + #ifndef LD_H 1.113 + #define LD_H 1.114 + 1.115 ++#ifndef ENABLE_NLS 1.116 ++# define _LIBINTL_H 1.117 ++# define _LIBGETTEXT_H 1.118 ++#endif 1.119 ++ 1.120 + #ifdef HAVE_LOCALE_H 1.121 + #endif 1.122 + #ifndef SEEK_CUR 1.123 +Index: ld/Makefile.in 1.124 +--- ld/Makefile.in.orig 2007-08-06 22:29:54 +0200 1.125 ++++ ld/Makefile.in 2007-08-29 09:30:04 +0200 1.126 +@@ -287,7 +287,7 @@ 1.127 + # We put the scripts in the directory $(scriptdir)/ldscripts. 1.128 + # We can't put the scripts in $(datadir) because the SEARCH_DIR 1.129 + # directives need to be different for native and cross linkers. 1.130 +-scriptdir = $(tooldir)/lib 1.131 ++scriptdir = $(libdir) 1.132 + BASEDIR = $(srcdir)/.. 1.133 + BFDDIR = $(BASEDIR)/bfd 1.134 + INCDIR = $(BASEDIR)/include 1.135 + 1.136 +----------------------------------------------------------------------------- 1.137 + 1.138 +workaround problems under Mac OS X. 1.139 + 1.140 +Index: libiberty/fibheap.c 1.141 +--- libiberty/fibheap.c.orig 2005-05-10 17:33:33 +0200 1.142 ++++ libiberty/fibheap.c 2007-08-29 09:30:04 +0200 1.143 +@@ -34,8 +34,11 @@ 1.144 + #include "libiberty.h" 1.145 + #include "fibheap.h" 1.146 + 1.147 +- 1.148 ++#ifdef LONG_MIN 1.149 + #define FIBHEAPKEY_MIN LONG_MIN 1.150 ++#else 1.151 ++#define FIBHEAPKEY_MIN (-0x7fffffffL - 1) 1.152 ++#endif 1.153 + 1.154 + static void fibheap_ins_root (fibheap_t, fibnode_t); 1.155 + static void fibheap_rem_root (fibheap_t, fibnode_t); 1.156 + 1.157 +----------------------------------------------------------------------------- 1.158 + 1.159 +Disable the "error" about "eh_frame_hdr" as it is actually more a 1.160 +warning (the linking is *not* aborted) and it occurs at least under 1.161 +FreeBSD-7.0/amd64 regularily without doing any obvious harm. Seems 1.162 +like the issue itself exists since a longer time, but in recent GNU 1.163 +binutils this additional message was introduced. As we cannot observe 1.164 +any problems and this message really confused, just disable it for now. 1.165 + 1.166 +Index: bfd/elf-eh-frame.c 1.167 +--- bfd/elf-eh-frame.c.orig 2007-08-06 21:59:22 +0200 1.168 ++++ bfd/elf-eh-frame.c 2007-11-11 15:46:44 +0100 1.169 +@@ -970,9 +970,11 @@ 1.170 + return offset != sec->rawsize; 1.171 + 1.172 + free_no_table: 1.173 ++#if 0 1.174 + (*info->callbacks->einfo) 1.175 + (_("%P: error in %B(%A); no .eh_frame_hdr table will be created.\n"), 1.176 + abfd, sec); 1.177 ++#endif 1.178 + if (ehbuf) 1.179 + free (ehbuf); 1.180 + if (sec_info)
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/binutils/binutils.spec Mon Jan 12 14:38:36 2009 +0100 2.3 @@ -0,0 +1,157 @@ 2.4 +## 2.5 +## binutils.spec -- OpenPKG RPM Package Specification 2.6 +## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/> 2.7 +## 2.8 +## Permission to use, copy, modify, and distribute this software for 2.9 +## any purpose with or without fee is hereby granted, provided that 2.10 +## the above copyright notice and this permission notice appear in all 2.11 +## copies. 2.12 +## 2.13 +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 2.14 +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 2.15 +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 2.16 +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR 2.17 +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2.18 +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 2.19 +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 2.20 +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 2.21 +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 2.22 +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 2.23 +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2.24 +## SUCH DAMAGE. 2.25 +## 2.26 + 2.27 +# package information 2.28 +Name: binutils 2.29 +Summary: GNU Binary Utilities 2.30 +URL: http://sources.redhat.com/binutils/ 2.31 +Vendor: Free Software Foundation 2.32 +Packager: OpenPKG Foundation e.V. 2.33 +Distribution: OpenPKG Community 2.34 +Class: CORE 2.35 +Group: Compiler 2.36 +License: GPL 2.37 +Version: 2.18 2.38 +Release: 20080101 2.39 + 2.40 +# list of sources 2.41 +Source0: ftp://sources.redhat.com/pub/binutils/releases/binutils-%{version}.tar.bz2 2.42 +Patch0: binutils.patch 2.43 + 2.44 +# build information 2.45 +Prefix: %{l_prefix} 2.46 +BuildRoot: %{l_buildroot} 2.47 +BuildPreReq: OpenPKG, openpkg >= 20060419, make 2.48 +PreReq: OpenPKG, openpkg >= 20060419 2.49 +AutoReq: no 2.50 +AutoReqProv: no 2.51 + 2.52 +%description 2.53 + Binutils is a collection of binary utilities. It includes: ld 2.54 + (the GNU linker), addr2line (converts addresses into filenames 2.55 + and line numbers), as (the portable GNU assembler), ar (a utility 2.56 + for creating, modifying and extracting from archives), nm (lists 2.57 + symbols from object files), objcopy (copys and translates object 2.58 + files), objdump (displays information from object files), ranlib 2.59 + (generates an index to the contents of an archive), readelf 2.60 + (displays information from any ELF format object file), size (lists 2.61 + the section sizes of an object or archive file), strings (lists 2.62 + printable strings from files), strip (discards symbols) and gprof 2.63 + (displays profiling information). 2.64 + 2.65 +%track 2.66 + prog binutils = { 2.67 + version = %{version} 2.68 + url = ftp://sources.redhat.com/pub/binutils/releases/ 2.69 + regex = binutils-(__VER__)\.tar\.bz2 2.70 + } 2.71 + 2.72 +%prep 2.73 + %setup -q 2.74 + %patch -p0 2.75 + 2.76 +%build 2.77 + # configure package 2.78 + CC="%{l_cc}"; export CC 2.79 + CFLAGS="%{l_cflags}"; export CFLAGS 2.80 + ARGS="" 2.81 + case "%{l_platform -t}" in 2.82 + *-freebsd* ) CFLAGS="$CFLAGS -DOPENPKG_OS_FREEBSD" ;; 2.83 + *-linux* ) CFLAGS="$CFLAGS -DOPENPKG_OS_LINUX" ;; 2.84 + *-sunos* ) CFLAGS="$CFLAGS -DOPENPKG_OS_SOLARIS" ;; 2.85 + *-aix* ) ARGS="$ARGS --without-gnu-as --without-gnu-ld" ;; 2.86 + *-darwin* ) ARGS="$ARGS --without-gnu-as --without-gnu-ld" ;; 2.87 + esac 2.88 + case "%{l_platform -t}" in 2.89 + amd64-sunos* ) ARGS="$ARGS --enable-64-bit-bdf" ;; 2.90 + esac 2.91 + ( echo "#!/bin/sh" 2.92 + echo "touch lex.yy.c" 2.93 + echo "echo 'lex.sh:WARNING: local Lex wrapper unexpectedly called.' 1>&2" 2.94 + ) >lex.sh && chmod a+x lex.sh 2.95 + echo "ac_cv_prog_LEX=`pwd`/lex.sh" >ld/config.cache 2.96 + INSTALL="%{l_shtool} install -c" \ 2.97 + AR="%{l_ar}" \ 2.98 + MAKE="%{l_make}" \ 2.99 + CONFIG_SHELL="%{l_bash}" \ 2.100 + ./configure \ 2.101 + --prefix=%{l_prefix} \ 2.102 + --includedir=%{l_prefix}/include/binutils \ 2.103 + --libdir=%{l_prefix}/lib/binutils \ 2.104 + --disable-werror \ 2.105 + --disable-nls \ 2.106 + $ARGS 2.107 + 2.108 + # build package 2.109 + %{l_make} %{l_mflags} 2.110 + 2.111 +%install 2.112 + rm -rf $RPM_BUILD_ROOT 2.113 + 2.114 + # build package 2.115 + %{l_make} %{l_mflags} install \ 2.116 + prefix=$RPM_BUILD_ROOT%{l_prefix} \ 2.117 + exec_prefix=$RPM_BUILD_ROOT%{l_prefix} \ 2.118 + includedir=$RPM_BUILD_ROOT%{l_prefix}/include/binutils \ 2.119 + libdir=$RPM_BUILD_ROOT%{l_prefix}/lib/binutils 2.120 + 2.121 + # platform specific stripping down of installation: 2.122 + # o GNU binutils strip(1) is broken on AIX, use of OS supplied 2.123 + # /usr/bin/strip from bos.rte.bind_cmds is mandatory. 2.124 + # o GNU binutils strip(1), ar(1) and ranlib(1) do not work under 2.125 + # Mac OS X (aka Darwin), system versions have to be used. 2.126 + case "%{l_platform -t}" in 2.127 + *-aix* ) 2.128 + rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/strip \ 2.129 + $RPM_BUILD_ROOT%{l_prefix}/man/man1/strip.1 2.130 + ;; 2.131 + *-darwin* ) 2.132 + rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/strip \ 2.133 + $RPM_BUILD_ROOT%{l_prefix}/man/man1/strip.1 2.134 + rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/ar \ 2.135 + $RPM_BUILD_ROOT%{l_prefix}/man/man1/ar.1 2.136 + rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/ranlib \ 2.137 + $RPM_BUILD_ROOT%{l_prefix}/man/man1/ranlib.1 2.138 + ;; 2.139 + esac 2.140 + 2.141 + # strip down installation 2.142 + rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir 2.143 + rm -f $RPM_BUILD_ROOT%{l_prefix}/info/standards.info 2.144 + rm -f $RPM_BUILD_ROOT%{l_prefix}/info/configure.info* 2.145 + rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/c++filt.1 2.146 + rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/dlltool.1 2.147 + rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/nlmconv.1 2.148 + rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/windres.1 2.149 + rm -rf $RPM_BUILD_ROOT%{l_prefix}/*-*-* 2.150 + rm -rf $RPM_BUILD_ROOT%{l_prefix}/bin/c++filt 2.151 + strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true 2.152 + 2.153 + # determine installation files 2.154 + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} 2.155 + 2.156 +%files -f files 2.157 + 2.158 +%clean 2.159 + rm -rf $RPM_BUILD_ROOT 2.160 +