Add .note.gnu.property runtime verification and merge support
[external/binutils.git] / packaging / binutils-aarch64.spec
1 %define cross aarch64
2 %define aarch64 1
3
4 %ifarch armv7l
5 %define ARCH armv7l
6 %define ABI eabi
7 %endif
8 %ifarch armv7hl
9 %define ARCH armv7hl
10 %define ABI eabihf
11 %endif
12 %ifarch %ix86
13 %define ARCH i586
14 %endif
15 %ifarch x86_64
16 %define ARCH x86_64
17 %endif
18 %ifarch aarch64
19 %define ARCH aarch64
20 %endif
21
22 %define host_arch %{ARCH}-tizen-linux-gnu%{?ABI}
23
24 %define target_cpu %{?cross}%{!?cross:%{ARCH}}
25 %define target_abi %{?cross:%{?armv7l:eabi}%{?armv7hl:eabihf}}%{!?cross:%{?ABI}}
26
27 %define target_arch %{target_cpu}-tizen-linux-gnu%{?target_abi}
28
29 %if 0%{?run_tests}
30 %define binutils_run_tests 1
31 %endif
32
33 Name:           binutils%{?cross:-%{cross}}
34 BuildRequires:  makeinfo
35 BuildRequires:  bison
36 BuildRequires:  flex
37 BuildRequires:  ncurses-devel
38 BuildRequires:  zlib-devel
39 BuildRequires:  gcc-c++
40 %if 0%{?binutils_run_tests}
41 BuildRequires:  dejagnu
42 BuildRequires:  gdb
43 BuildRequires:  glibc-devel-static
44 %endif
45 Version:        2.27
46 Release:        0
47 Url:            http://www.gnu.org/software/binutils/
48 Summary:        GNU Binutils
49 License:        GFDL-1.3 and GPL-3.0+
50 Group:          Development/Building
51 %{?cross:ExcludeArch: %{cross}}
52 Source:         binutils-%{version}.tar.bz2
53 Source1001:     binutils.manifest
54
55 %description
56 C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib,
57 size, strings, and strip. These utilities are needed whenever you want
58 to compile a program or kernel.
59
60
61 %package gold
62 Summary:        The gold linker
63 License:        GPL-3.0+
64 Group:          Development/Building
65
66 %description gold
67 gold is an ELF linker.  It is intended to have complete support for ELF
68 and to run as fast as possible on modern systems.  For normal use it is
69 a drop-in replacement for the older GNU linker.
70
71
72 %package devel
73 Summary:        GNU binutils (BFD development files)
74 License:        GPL-3.0+
75 Group:          Development/Building
76 Requires: zlib-devel
77
78 %description devel
79 This package includes header files and static libraries necessary to
80 build programs which use the GNU BFD library, which is part of
81 binutils.
82
83
84 %prep
85 %setup -q -n binutils-%{version}
86 cp %{SOURCE1001} .
87
88
89 %build
90 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error %{?cross:-DIGNORE_BROKEN_PLUGINS}"
91 export CFLAGS="${RPM_OPT_FLAGS}"
92 export CXXFLAGS="${RPM_OPT_FLAGS}"
93
94 mkdir build-dir
95 cd build-dir
96
97 ../configure \
98         --prefix=%{_prefix} --libdir=%{_libdir} \
99         --infodir=%{_infodir} --mandir=%{_mandir} \
100         --with-bugurl=http://bugs.tizen.org/ \
101         --with-sysroot=/ \
102         --disable-nls \
103         --with-separate-debug-dir=%{_prefix}/lib/debug \
104         --with-pic \
105         --build=%{host_arch} --target=%{target_arch} \
106         --host=%{host_arch} \
107         %{?annobin_verification: --enable-annobin-verification=warn } \
108         %{?annobin_verification_strict: --enable-annobin-verification=strict } \
109 %{?cross: \
110         --enable-targets=%{target_arch} \
111         --enable-64-bit-bfd \
112 } \
113 %{!?cross: \
114         --enable-targets=aarch64-tizen-linux,armv7l-tizen-linux,armv7hl-tizen-linux,armv8l-tizen-linux,i686-tizen-linux,x86_64-tizen-linux \
115 } \
116         --enable-plugins \
117         --enable-gold \
118         --enable-shared \
119         --enable-new-dtags
120
121 make %{?_smp_mflags}
122
123 %check
124 %{?binutils_run_tests:
125     make %{?_smp_mflags} -C build-dir check -k
126 }
127
128 %install
129 cd build-dir
130 make DESTDIR=$RPM_BUILD_ROOT install
131
132 # Copy instead of hardlinks
133 for binary in ar as ld{,.bfd,.gold} nm obj{dump,copy} ranlib strip
134 do
135   rm %{buildroot}%{_prefix}/%{target_arch}/bin/$binary
136 %{!?cross:
137   cp %{buildroot}%{_bindir}/$binary %{buildroot}%{_prefix}/%{target_arch}/bin/$binary
138 }
139 %{?cross:
140   cp %{buildroot}%{_bindir}/%{target_arch}-$binary %{buildroot}%{_prefix}/%{target_arch}/bin/$binary
141 }
142 done
143
144 install -m 644 libiberty/pic/libiberty.a %{buildroot}%{_prefix}/%{_lib}
145 install -m 644 ../include/libiberty.h %{buildroot}%{_prefix}/include
146
147 # Remove unwanted files to shut up rpm
148 %{remove_docs}
149 rm -rf %{buildroot}%{_bindir}/gcore
150 rm -rf %{buildroot}%{_bindir}/gdb*
151 rm -rf %{buildroot}%{_datadir}/gdb
152 rm -rf %{buildroot}%{_libdir}/lib{bfd,opcodes,inproctrace}.{so,la}
153 %{?cross:
154 rm -rf %{buildroot}%{_prefix}/%{target_arch}/lib/ldscripts
155 rm -rf %{buildroot}%{_prefix}/%{host_arch}
156 rm -rf %{buildroot}%{_includedir}
157 rm -rf %{buildroot}%{_prefix}/lib*
158 rm -rf %{buildroot}%{_datadir}
159 }
160
161 %files
162 %manifest binutils.manifest
163 %defattr(-,root,root)
164 %{_bindir}/*
165 %{_prefix}/%{target_arch}/bin/*
166 %{!?cross:
167 %exclude %{_bindir}/ld.gold
168 %exclude %{_prefix}/%{target_arch}/bin/ld.gold
169 %{_libdir}/*.so
170 %{_prefix}/%{host_arch}/lib/ldscripts
171
172 %files devel
173 %manifest binutils.manifest
174 %defattr(-,root,root)
175 %{_includedir}/*.h
176 %{_includedir}/gdb/*.h
177 %{_libdir}/*.a
178
179 %files gold
180 %manifest binutils.manifest
181 %defattr(-,root,root)
182 %{_bindir}/ld.gold
183 %{_prefix}/%{target_arch}/bin/ld.gold
184 }
185
186 %changelog