diff --git a/SPECS/cross-binutils/cross-binutils.signatures.json b/SPECS/cross-binutils/cross-binutils.signatures.json new file mode 100644 index 00000000000..80865e22540 --- /dev/null +++ b/SPECS/cross-binutils/cross-binutils.signatures.json @@ -0,0 +1,5 @@ +{ + "Signatures": { + "binutils-2.37.tar.xz": "820d9724f020a3e69cb337893a0b63c2db161dadcb0e06fc11dc29eb1e84a32c" + } +} \ No newline at end of file diff --git a/SPECS/cross-binutils/cross-binutils.spec b/SPECS/cross-binutils/cross-binutils.spec new file mode 100644 index 00000000000..9a3afc5e02e --- /dev/null +++ b/SPECS/cross-binutils/cross-binutils.spec @@ -0,0 +1,328 @@ +# Globals which should be in a macro file. +# These should be set programatically in the future. +%global _host_arch x86_64 +%global _target_arch aarch64 +%global _tuple %{_target_arch}-%{_vendor}-linux-gnu +%global _cross_name %{_target_arch}-%{_vendor}-linux-gnu + +# Folders which should be in our macro file +%global _opt /opt/ +%global _crossdir /opt/cross/ + +# Generally we include '/usr' in most paths. +# Can we also use '/usr' for our paths? This will bring us in line with the +# %%configure macro which sets these. +%global _bindir /bin +%global _sbindir /sbin +%global _libdir /lib +%global _lib64dir /lib64 +%global _libexecdir /libexec +%global _datadir /share +%global _docdir /share/doc +%global _includedir /include +%global _infodir /share/info +%global _mandir /share/man +%global _oldincludedir /include + + +# Why is this wrong? We get "x86_64-pc-linux-gnu" when eval'd, but our +# tools select "aarch64-linux-gnu" +%global _host_vendor %{nil} + +# If we want our cross compile aware packges to also support native, we +# need logic to switch modes something like this: +%if "%{_target_arch}" != "%{_host_arch}" +%global _cross_prefix %{_crossdir}%{_tuple}/ +%global _cross_sysroot %{_crossdir}%{_tuple}/sysroot/ +%global _cross_includedir /usr/%{_host}/%{_tuple}/include/ +%global _cross_infodir %{_crossdir}%{_tuple}/share/info +%global _cross_bindir %{_tuple}/bin +%global _cross_libdir %{_tuple}/lib +%global _tuple_name %{_tuple}- +%else +%global _cross_prefix %{nil} +%global _cross_sysroot %{nil} +%global _cross_includedir %{_includedir} +%global _cross_infodir %{_infodir} +%global _cross_bindir %{_bindir} +%global _cross_libdir %{_libdir} +%global _tuple_name %{nil} +%endif + +Summary: Contains a linker, an assembler, and other tools +Name: %{_cross_name}-binutils +Version: 2.37 +Release: 8%{?dist} +License: GPLv2+ +URL: http://www.gnu.org/software/binutils +Group: System Environment/Base +Vendor: Microsoft Corporation +Distribution: Mariner +ExclusiveArch: x86_64 +Source0: http://ftp.gnu.org/gnu/binutils/binutils-%{version}.tar.xz +# Patch was derived from source: https://src.fedoraproject.org/rpms/binutils/blob/f34/f/binutils-export-demangle.h.patch +Patch0: export-demangle-header.patch +# Patch1 Source https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=6b86da53d5ee2022b9065f445d23356190380746 +Patch1: linker-script-readonly-keyword-support.patch +Patch2: thin_archive_descriptor.patch + +%description +The Binutils package contains a linker, an assembler, +and other tools for handling object files. + +%prep +%autosetup -p1 -n binutils-%{version} + +%build +# Ideally we would like to model this after the %%configure macro in the future. +./configure \ + --prefix=%{_cross_prefix} \ + --target=%{_tuple} \ + --disable-multilib \ + --with-sysroot=%{_cross_sysroot} + +make %{?_smp_mflags} + +%install +make %{?_smp_mflags} DESTDIR=%{buildroot} install + +find %{buildroot} -name '*.la' -delete +rm -rf %{buildroot}/%{_cross_infodir} +%find_lang %{name} --all-name + +%files -f %{name}.lang +%defattr(-,root,root) +%license COPYING +#%%{_cross_prefix}%%{_cross_bindir}/dwp +#%%{_cross_prefix}%%{_cross_bindir}/gprof +%{_cross_prefix}%{_cross_bindir}/ld.bfd +#%%{_cross_prefix}%%{_cross_bindir}/ld.gold +#%%{_cross_prefix}%%{_cross_bindir}/c++filt +%{_cross_prefix}%{_cross_bindir}/objdump +%{_cross_prefix}%{_cross_bindir}/as +%{_cross_prefix}%{_cross_bindir}/ar +%{_cross_prefix}%{_cross_bindir}/objcopy +#%%{_cross_prefix}%%{_cross_bindir}/strings +#%%{_cross_prefix}%%{_cross_bindir}/addr2line +%{_cross_prefix}%{_cross_bindir}/nm +#%%{_cross_prefix}%%{_cross_bindir}/size +%{_cross_prefix}%{_cross_bindir}/ld +#%%{_cross_prefix}%%{_cross_bindir}/elfedit +%{_cross_prefix}%{_cross_bindir}/ranlib +%{_cross_prefix}%{_cross_bindir}/readelf +%{_cross_prefix}%{_cross_bindir}/strip + +# These duplicates are not found in the normal binutils +#%%{_cross_prefix}%%{_bindir}/%%{_tuple_name}dwp +%{_cross_prefix}%{_bindir}/%{_tuple_name}gprof +%{_cross_prefix}%{_bindir}/%{_tuple_name}ld.bfd +#%%{_cross_prefix}%%{_bindir}/%%{_tuple_name}ld.gold +%{_cross_prefix}%{_bindir}/%{_tuple_name}c++filt +%{_cross_prefix}%{_bindir}/%{_tuple_name}objdump +%{_cross_prefix}%{_bindir}/%{_tuple_name}as +%{_cross_prefix}%{_bindir}/%{_tuple_name}ar +%{_cross_prefix}%{_bindir}/%{_tuple_name}objcopy +%{_cross_prefix}%{_bindir}/%{_tuple_name}strings +%{_cross_prefix}%{_bindir}/%{_tuple_name}addr2line +%{_cross_prefix}%{_bindir}/%{_tuple_name}nm +%{_cross_prefix}%{_bindir}/%{_tuple_name}size +%{_cross_prefix}%{_bindir}/%{_tuple_name}ld +%{_cross_prefix}%{_bindir}/%{_tuple_name}elfedit +%{_cross_prefix}%{_bindir}/%{_tuple_name}ranlib +%{_cross_prefix}%{_bindir}/%{_tuple_name}readelf +%{_cross_prefix}%{_bindir}/%{_tuple_name}strip + +%{_cross_prefix}%{_cross_libdir}/ldscripts/* +#%%{_cross_prefix}%{_cross_libdir}/bfd-plugins/libdep.so +"/opt/cross/aarch64-mariner-linux-gnu/lib/bfd-plugins/libdep.so" + +%{_cross_prefix}%{_mandir}/man1/%{_tuple_name}readelf.1 +%{_cross_prefix}%{_mandir}/man1/%{_tuple_name}windmc.1 +%{_cross_prefix}%{_mandir}/man1/%{_tuple_name}ranlib.1 +%{_cross_prefix}%{_mandir}/man1/%{_tuple_name}gprof.1 +%{_cross_prefix}%{_mandir}/man1/%{_tuple_name}strip.1 +%{_cross_prefix}%{_mandir}/man1/%{_tuple_name}c++filt.1 +%{_cross_prefix}%{_mandir}/man1/%{_tuple_name}as.1 +%{_cross_prefix}%{_mandir}/man1/%{_tuple_name}objcopy.1 +%{_cross_prefix}%{_mandir}/man1/%{_tuple_name}elfedit.1 +%{_cross_prefix}%{_mandir}/man1/%{_tuple_name}strings.1 +%{_cross_prefix}%{_mandir}/man1/%{_tuple_name}nm.1 +%{_cross_prefix}%{_mandir}/man1/%{_tuple_name}ar.1 +%{_cross_prefix}%{_mandir}/man1/%{_tuple_name}ld.1 +%{_cross_prefix}%{_mandir}/man1/%{_tuple_name}dlltool.1 +%{_cross_prefix}%{_mandir}/man1/%{_tuple_name}addr2line.1 +%{_cross_prefix}%{_mandir}/man1/%{_tuple_name}windres.1 +%{_cross_prefix}%{_mandir}/man1/%{_tuple_name}size.1 +%{_cross_prefix}%{_mandir}/man1/%{_tuple_name}objdump.1 + +# These are the -devel files, we are not generating them. +#%%{_cross_prefix}%%{_libdir}/libbfd-%%{version}.so +#%%{_cross_prefix}%%{_libdir}/libopcodes-%%{version}.so + +#Headers are available in the debug folder only, or not at all. +#%%{_cross_prefix}%%{_cross_includedir}/plugin-api.h +#%%{_cross_prefix}%%{_cross_includedir}/symcat.h +#%%{_cross_prefix}%%{_cross_includedir}/bfd.h +#%%{_cross_prefix}%%{_cross_includedir}/ansidecl.h +#%%{_cross_prefix}%%{_cross_includedir}/bfdlink.h +#%%{_cross_prefix}%%{_cross_includedir}/dis-asm.h +#%%{_cross_prefix}%%{_cross_includedir}/diagnostics.h + +#%%{_cross_prefix}%%{_libdir}/libbfd.a +#%%{_cross_prefix}%%{_libdir}/libopcodes.a +#%%{_cross_prefix}%%{_libdir}/libbfd.so +#%%{_cross_prefix}%%{_libdir}/libopcodes.so + +%changelog +* Thu Dec 15 2022 Dallas Delaney - 2.37-8 +- Fork normal binutils package into cross compile aware package + +* Wed Sep 20 2023 Jon Slobodzian - 2.37-7 +- Recompile with stack-protection fixed gcc version (CVE-2023-4039) + +* Tue Aug 29 2023 Andy Zaugg - 2.37-6 +- Use the pic'ed libiberty.a version + +* Wed Feb 08 2023 Rachel Menge - 2.37-5 +- Backport upstream patch to fix CVE-2022-4285 + +* Thu Sep 01 2022 Henry Beberman - 2.37-4 +- Backport upstream patch to fix CVE-2022-38533 + +* Wed Apr 20 2022 Andrew Phelps - 2.37-3 +- Add patch to fix CVE-2021-45078 + +* Fri Dec 03 2021 Andrew Phelps - 2.37-2 +- Add thin_archive_descriptor.patch to fix nodejs build issue + +* Thu Nov 04 2021 Andrew Phelps - 2.37-1 +- Update version to 2.37 +- Update export-demangle-header.patch + +* Fri Oct 15 2021 Ismail Kose - 2.36.1-4 +- Adding READONLY keyword support in linker script +- Verified license + +* Tue Sep 14 2021 Pawel Winogrodzki - 2.36.1-3 +- Adding 'libiberty' lib and header. + +* Tue Aug 24 2021 Thomas Crain - 2.36.1-2 +- Add patch from Fedora 34 (license: MIT) to export demangle.h from libiberty sources +- Lint spec + +* Tue May 11 2021 Andrew Phelps - 2.36.1-1 +- Update to version 2.36.1 + +* Mon Jan 11 2021 Emre Girgin - 2.32-5 +- Update URL and Source0 to use https. +- Fix CVE-2020-35493. +- Fix CVE-2020-35494. +- Fix CVE-2020-35495. +- Fix CVE-2020-35496. +- Fix CVE-2020-35507. + +* Thu Oct 22 2020 Nicolas Ontiveros - 2.32-4 +- Use autosetup +- Fix CVE-2019-12972. +- Fix CVE-2019-14250. +- Fix CVE-2019-14444. +- Fix CVE-2019-9071. +- No patch CVE-2019-9072. +- Fix CVE-2019-9073. +- Fix CVE-2019-9074. +- No patch CVE-2019-9076. +- Fix CVE-2019-17450. +- Fix CVE-2019-17451. + +* Sat May 09 00:21:17 PST 2020 Nick Samson - 2.32-3 +- Added %%license line automatically + +* Wed May 06 2020 Nicolas Ontiveros 2.32-2 +- Fix CVE-2019-9077. +- Fix CVE-2019-9075. +- Fix CVE-2019-9070. +- Remove sha1 macro. + +* Thu Feb 06 2020 Andrew Phelps 2.32-1 +- Update to version 2.32 + +* Tue Sep 03 2019 Mateusz Malisz 2.31.1-5 +- Initial CBL-Mariner import from Photon (license: Apache2). + +* Thu Mar 14 2019 Priyesh Padmavilasom 2.31.1-4 +- Fix CVE-2019-9075 and CVE-2019-9077 + +* Tue Jan 22 2019 Anish Swaminathan 2.31.1-3 +- fix CVE-2018-1000876 + +* Tue Jan 08 2019 Alexey Makhalov 2.31.1-2 +- Fix CVE-2018-17358, CVE-2018-17359 and CVE-2018-17360 + +* Fri Sep 21 2018 Keerthana K 2.31.1-1 +- Update to version 2.31.1 + +* Wed Aug 1 2018 Keerthana K 2.31-1 +- Update to version 2.31. + +* Thu Jun 7 2018 Keerthana K 2.30-4 +- Fix CVE-2018-10373 + +* Mon Mar 19 2018 Alexey Makhalov 2.30-3 +- Add libiberty to the -devel package + +* Wed Feb 28 2018 Xiaolin Li 2.30-2 +- Fix CVE-2018-6543. + +* Mon Jan 29 2018 Xiaolin Li 2.30-1 +- Update to version 2.30 + +* Mon Dec 18 2017 Anish Swaminathan 2.29.1-5 +- Fix CVEs CVE-2017-17121, CVE-2017-17122, CVE-2017-17123, +- CVE-2017-17124, CVE-2017-17125 + +* Mon Dec 4 2017 Anish Swaminathan 2.29.1-4 +- Fix CVEs CVE-2017-16826, CVE-2017-16827, CVE-2017-16828, CVE-2017-16829, +- CVE-2017-16830, CVE-2017-16831, CVE-2017-16832 + +* Tue Nov 14 2017 Alexey Makhalov 2.29.1-3 +- Aarch64 support +- Parallel build + +* Thu Oct 12 2017 Anish Swaminathan 2.29.1-2 +- Add patch to fix CVE-2017-15020 + +* Mon Oct 2 2017 Anish Swaminathan 2.29.1-1 +- Version update to 2.29.1, fix CVEs CVE-2017-12799, CVE-2017-14729,CVE-2017-14745 + +* Fri Aug 11 2017 Anish Swaminathan 2.29-3 +- Apply patches for CVE-2017-12448,CVE-2017-12449,CVE-2017-12450,CVE-2017-12451, +- CVE-2017-12452,CVE-2017-12453,CVE-2017-12454,CVE-2017-12455,CVE-2017-12456, +- CVE-2017-12457,CVE-2017-12458,CVE-2017-12459 + +* Tue Aug 8 2017 Rongrong Qiu 2.29-2 +- fix for make check for bug 1900247 + +* Wed Aug 2 2017 Alexey Makhalov 2.29-1 +- Version update + +* Tue May 16 2017 Priyesh Padmavilasom 2.28-2 +- Patch for CVE-2017-8421 + +* Thu Apr 06 2017 Anish Swaminathan 2.28-1 +- Upgraded to version 2.28 +- Apply patch for CVE-2017-6969 + +* Tue May 24 2016 Priyesh Padmavilasom 2.25.1-2 +- GA - Bump release of all rpms + +* Tue Jan 12 2016 Xiaolin Li 2.25.1-1 +- Updated to version 2.25.1 + +* Tue Nov 10 2015 Xiaolin Li 2.25-2 +- Handled locale files with macro find_lang + +* Mon Apr 6 2015 Priyesh Padmavilasom 2.25-1 +- Updated to 2.25 + +* Wed Nov 5 2014 Divya Thaluru 2.24-1 +- Initial build. First version diff --git a/SPECS/cross-binutils/export-demangle-header.patch b/SPECS/cross-binutils/export-demangle-header.patch new file mode 100644 index 00000000000..52ce3cc90be --- /dev/null +++ b/SPECS/cross-binutils/export-demangle-header.patch @@ -0,0 +1,32 @@ +--- binutils-orig/bfd/Makefile.am 2021-10-12 16:08:25.240958114 -0700 ++++ binutils-2.37/bfd/Makefile.am 2021-10-12 16:09:47.460421162 -0700 +@@ -33,7 +33,7 @@ + bfdincludedir = @bfdincludedir@ + bfdlib_LTLIBRARIES = libbfd.la + bfdinclude_HEADERS = $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ +- $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h ++ $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h $(INCDIR)/demangle.h + else !INSTALL_LIBBFD + # Empty these so that the respective installation directories will not be created. + bfdlibdir = + +--- binutils-orig/bfd/Makefile.in 2021-10-12 16:08:25.236958141 -0700 ++++ binutils-2.37/bfd/Makefile.in 2021-10-12 16:10:57.531986774 -0700 +@@ -249,7 +249,7 @@ + esac + am__bfdinclude_HEADERS_DIST = $(INCDIR)/plugin-api.h bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ +- $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h ++ $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h $(INCDIR)/demangle.h + HEADERS = $(bfdinclude_HEADERS) + RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +@@ -469,7 +469,7 @@ + @INSTALL_LIBBFD_FALSE@bfdinclude_HEADERS = $(am__append_2) + @INSTALL_LIBBFD_TRUE@bfdinclude_HEADERS = $(BFD_H) \ + @INSTALL_LIBBFD_TRUE@ $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ +-@INSTALL_LIBBFD_TRUE@ $(INCDIR)/diagnostics.h \ ++@INSTALL_LIBBFD_TRUE@ $(INCDIR)/diagnostics.h $(INCDIR)/demangle.h \ + @INSTALL_LIBBFD_TRUE@ $(INCDIR)/bfdlink.h $(am__append_2) + @INSTALL_LIBBFD_FALSE@rpath_bfdlibdir = @bfdlibdir@ + @INSTALL_LIBBFD_FALSE@noinst_LTLIBRARIES = libbfd.la diff --git a/SPECS/cross-binutils/linker-script-readonly-keyword-support.patch b/SPECS/cross-binutils/linker-script-readonly-keyword-support.patch new file mode 100644 index 00000000000..f62088b24b5 --- /dev/null +++ b/SPECS/cross-binutils/linker-script-readonly-keyword-support.patch @@ -0,0 +1,156 @@ +From 6b86da53d5ee2022b9065f445d23356190380746 Mon Sep 17 00:00:00 2001 +From: Luca Boccassi +Date: Wed, 21 Jul 2021 14:32:03 +0100 +Subject: [PATCH] Allows linker scripts to set the SEC_READONLY flag. + +* ld.texi: Document new output section type. +* ldgram.y: Add new token. +* ldlang.c: Handle the new flag. +* ldlang.h: Add readonly_section to list of section types. +* ldlex.l: Add a new identifier. +* testsuite/ld-scripts/output-section-types.t: New example linker script. +* testsuite/ld-scripts/output-section-types.d: Test driver. +* testsyute/ld-scripts/script.exp: Run the new test. +--- + ld/ld.texi | 2 ++ + ld/ldgram.y | 2 ++ + ld/ldlang.c | 6 ++++++ + ld/ldlang.h | 3 ++- + ld/ldlex.l | 1 + + ld/testsuite/ld-scripts/output-section-types.d | 13 +++++++++++++ + ld/testsuite/ld-scripts/output-section-types.t | 7 +++++++ + ld/testsuite/ld-scripts/script.exp | 1 + + 8 files changed, 34 insertions(+), 1 deletion(-) + create mode 100644 ld/testsuite/ld-scripts/output-section-types.d + create mode 100644 ld/testsuite/ld-scripts/output-section-types.t + +diff --git a/ld/ld.texi b/ld/ld.texi +index b6d8dccea0b..60bb071fb79 100644 +--- a/ld/ld.texi ++++ b/ld/ld.texi +@@ -5474,6 +5474,8 @@ parentheses. The following types are defined: + @item NOLOAD + The section should be marked as not loadable, so that it will not be + loaded into memory when the program is run. ++@item READONLY ++The section should be marked as read-only. + @item DSECT + @itemx COPY + @itemx INFO +diff --git a/ld/ldgram.y b/ld/ldgram.y +index dd911f46169..31e0071c6fc 100644 +--- a/ld/ldgram.y ++++ b/ld/ldgram.y +@@ -139,6 +139,7 @@ static int error_index; + %token REGION_ALIAS + %token LD_FEATURE + %token NOLOAD DSECT COPY INFO OVERLAY ++%token READONLY + %token DEFINED TARGET_K SEARCH_DIR MAP ENTRY + %token NEXT + %token SIZEOF ALIGNOF ADDR LOADADDR MAX_K MIN_K +@@ -1123,6 +1124,7 @@ type: + | COPY { sectype = noalloc_section; } + | INFO { sectype = noalloc_section; } + | OVERLAY { sectype = noalloc_section; } ++ | READONLY { sectype = readonly_section; } + ; + + atype: +diff --git a/ld/ldlang.c b/ld/ldlang.c +index 37b64c89ee1..2610be995ca 100644 +--- a/ld/ldlang.c ++++ b/ld/ldlang.c +@@ -2639,6 +2639,9 @@ lang_add_section (lang_statement_list_type *ptr, + case noalloc_section: + flags &= ~SEC_ALLOC; + break; ++ case readonly_section: ++ flags |= SEC_READONLY; ++ break; + case noload_section: + flags &= ~SEC_LOAD; + flags |= SEC_NEVER_LOAD; +@@ -4232,6 +4235,9 @@ map_input_to_output_sections + case noalloc_section: + flags = SEC_HAS_CONTENTS; + break; ++ case readonly_section: ++ flags |= SEC_READONLY; ++ break; + case noload_section: + if (bfd_get_flavour (link_info.output_bfd) + == bfd_target_elf_flavour) +diff --git a/ld/ldlang.h b/ld/ldlang.h +index 6fbe16d97d9..f68ae27b409 100644 +--- a/ld/ldlang.h ++++ b/ld/ldlang.h +@@ -121,7 +121,8 @@ enum section_type + first_overlay_section, + overlay_section, + noload_section, +- noalloc_section ++ noalloc_section, ++ readonly_section + }; + + /* This structure holds a list of program headers describing +diff --git a/ld/ldlex.l b/ld/ldlex.l +index c1b15263587..25b4bcaae01 100644 +--- a/ld/ldlex.l ++++ b/ld/ldlex.l +@@ -294,6 +294,7 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)* + "SORT_BY_INIT_PRIORITY" { RTOKEN(SORT_BY_INIT_PRIORITY); } + "SORT_NONE" { RTOKEN(SORT_NONE); } + "NOLOAD" { RTOKEN(NOLOAD);} ++"READONLY" { RTOKEN(READONLY);} + "DSECT" { RTOKEN(DSECT);} + "COPY" { RTOKEN(COPY);} + "INFO" { RTOKEN(INFO);} +diff --git a/ld/testsuite/ld-scripts/output-section-types.d b/ld/testsuite/ld-scripts/output-section-types.d +new file mode 100644 +index 00000000000..ab124fa4dd7 +--- /dev/null ++++ b/ld/testsuite/ld-scripts/output-section-types.d +@@ -0,0 +1,13 @@ ++#ld: -Toutput-section-types.t ++#source: align2a.s ++#objdump: -h ++#target: [is_elf_format] ++ ++#... ++ . \.rom.* ++[ ]+ALLOC, READONLY ++ . \.ro.* ++[ ]+CONTENTS, ALLOC, LOAD, READONLY, DATA ++ . \.over.* ++[ ]+CONTENTS, READONLY ++#pass +diff --git a/ld/testsuite/ld-scripts/output-section-types.t b/ld/testsuite/ld-scripts/output-section-types.t +new file mode 100644 +index 00000000000..d8fdfda1a03 +--- /dev/null ++++ b/ld/testsuite/ld-scripts/output-section-types.t +@@ -0,0 +1,7 @@ ++SECTIONS { ++ .rom (NOLOAD) : { LONG(1234); } ++ .ro (READONLY) : { LONG(5678); } ++ .over (OVERLAY) : { LONG(0123); } ++ /DISCARD/ : { *(*) } ++ ++} +diff --git a/ld/testsuite/ld-scripts/script.exp b/ld/testsuite/ld-scripts/script.exp +index 961cd08c4b1..ff50199b3ae 100644 +--- a/ld/testsuite/ld-scripts/script.exp ++++ b/ld/testsuite/ld-scripts/script.exp +@@ -229,6 +229,7 @@ foreach test_script $test_script_list { + + run_dump_test "align-with-input" + run_dump_test "pr20302" ++run_dump_test "output-section-types" + + run_dump_test "segment-start" {{name (default)}} + run_dump_test "segment-start" {{name (overridden)} \ +-- +2.27.0 + diff --git a/SPECS/cross-binutils/thin_archive_descriptor.patch b/SPECS/cross-binutils/thin_archive_descriptor.patch new file mode 100644 index 00000000000..45c89fdd18a --- /dev/null +++ b/SPECS/cross-binutils/thin_archive_descriptor.patch @@ -0,0 +1,32 @@ +Close the thin archive file descriptor since it can't be used directly +to access archive members. This avoids running out of file descriptors +on thin archives with many archive members. + + PR ld/28138 + * plugin.c (bfd_plugin_close_file_descriptor): Close the thin + archive file descriptor. +--- + bfd/plugin.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/bfd/plugin.c b/bfd/plugin.c +index 6cfa2b66470..066c96581a2 100644 +--- a/bfd/plugin.c ++++ b/bfd/plugin.c +@@ -291,6 +291,14 @@ bfd_plugin_close_file_descriptor (bfd *abfd, int fd) + && !bfd_is_thin_archive (abfd->my_archive)) + abfd = abfd->my_archive; + ++ /* Close the thin archive file descriptor since it can't be used ++ directly to access archive members. */ ++ if (abfd->my_archive && bfd_is_thin_archive (abfd->my_archive)) ++ { ++ close (fd); ++ return; ++ } ++ + abfd->archive_plugin_fd_open_count--; + /* Dup the archive plugin file descriptor for later use, which + will be closed by _bfd_archive_close_and_cleanup. */ +-- +2.31.1 diff --git a/SPECS/cross-gcc-bootstrap/CVE-2019-15847.nopatch b/SPECS/cross-gcc-bootstrap/CVE-2019-15847.nopatch new file mode 100644 index 00000000000..e69de29bb2d diff --git a/SPECS/cross-gcc-bootstrap/cross-gcc-bootstrap.signatures.json b/SPECS/cross-gcc-bootstrap/cross-gcc-bootstrap.signatures.json new file mode 100644 index 00000000000..8f92aad00ec --- /dev/null +++ b/SPECS/cross-gcc-bootstrap/cross-gcc-bootstrap.signatures.json @@ -0,0 +1,8 @@ +{ + "Signatures": { + "gcc-11.2.0.tar.xz": "d08edc536b54c372a1010ff6619dd274c0f1603aa49212ba20f7aa2cda36fa8b", + "gmp-6.2.1.tar.xz": "fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2", + "mpc-1.2.1.tar.gz": "17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459", + "mpfr-4.1.0.tar.xz": "0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f" + } +} \ No newline at end of file diff --git a/SPECS/cross-gcc-bootstrap/cross-gcc-bootstrap.spec b/SPECS/cross-gcc-bootstrap/cross-gcc-bootstrap.spec new file mode 100644 index 00000000000..b114b0e0547 --- /dev/null +++ b/SPECS/cross-gcc-bootstrap/cross-gcc-bootstrap.spec @@ -0,0 +1,437 @@ +%global security_hardening nofortify +%global debug_package %{nil} +%global set_build_flags %{nil} +%define __os_install_post %{nil} + +%define _use_internal_dependency_generator 0 + +# Globals which should be in a macro file. +# These should be set programatically in the future. +%global _host_arch x86_64 +%global _target_arch aarch64 + +%global _tuple %{_target_arch}-%{_vendor}-linux-gnu +%global _cross_name %{_target_arch}-%{_vendor}-linux-gnu + +# Folders which should be in our macro file +%global _opt /opt/ +%global _crossdir /opt/cross/ + +# Generally we include '/usr' in most paths. +# Can we also use '/usr' for our paths? This will bring us in line with the +# %%configure macro which sets these. +%global _bindir /bin +%global _sbindir /sbin +%global _libdir /lib +%global _lib64dir /lib64 +%global _libexecdir /libexec +%global _datadir /share +%global _docdir /share/doc +%global _includedir /include +%global _infodir /share/info +%global _mandir /share/man +%global _oldincludedir /include + +# If we want our cross compile aware packges to also support native, we +# need logic to switch modes something like this: +%if "%{_target_arch}" != "%{_host_arch}" +%global _cross_prefix %{_crossdir}%{_tuple}/ +%global _cross_sysroot %{_crossdir}%{_tuple}/sysroot/ +%global _cross_includedir /usr/%{_host}/%{_tuple}/include/ +%global _cross_infodir %{_crossdir}%{_tuple}/share/info +%global _cross_bindir %{_tuple}/bin +%global _cross_libdir %{_tuple}/lib +%global _tuple_name %{_tuple}- +%else +%global _cross_prefix %{nil} +%global _cross_sysroot %{nil} +%global _cross_includedir %{_includedir} +%global _cross_infodir %{_infodir} +%global _cross_bindir %{_bindir} +%global _cross_libdir %{_libdir} +%global _tuple_name %{nil} +%endif + +Summary: Contains the GNU compiler collection +Name: %{_cross_name}-gcc-bootstrap +Version: 11.2.0 +Release: 2%{?dist} +License: GPLv2+ +Vendor: Microsoft Corporation +Distribution: Mariner +Group: Development/Tools +URL: https://gcc.gnu.org/ +Source0: https://ftp.gnu.org/gnu/gcc/%{name}-%{version}/gcc-%{version}.tar.xz +Source1: https://ftp.gnu.org/gnu/mpfr/mpfr-4.1.0.tar.xz +Source2: http://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.xz +Source3: https://ftp.gnu.org/gnu/mpc/mpc-1.2.1.tar.gz +# Only applies to the Power9 ISA +BuildRequires: %{_cross_name}-binutils +BuildRequires: %{_cross_name}-kernel-headers +AutoReqProv: no +ExclusiveArch: x86_64 +Conflicts: %{_cross_name}-cross-gcc +#%%if %%{with_check} +#BuildRequires: autogen +#BuildRequires: dejagnu +#%%endif + +#Merge all of the packages for the bootstrap packages +# (Only gfortran, c++ sub packages are built for bootstrap 1) + +%description +The GCC package contains the GNU compiler collection, +which includes the C and C++ compilers. + +# %%package -n gfortran +# Summary: GNU Fortran compiler. +# Group: Development/Tools +# Requires: %%{_cross_name}-gcc = %%{version}-%%{release} +# Provides: %%{_cross_name}-gcc-gfortran = %%{version}-%%{release} + +# %%description -n gfortran +# The gfortran package contains GNU Fortran compiler. + +# %%package -n libgcc +# Summary: GNU C Library +# Group: System Environment/Libraries + +# %%description -n libgcc +# The libgcc package contains GCC shared libraries for gcc. + +# %%package -n libgcc-atomic +# Summary: GNU C Library for atomic counter updates +# Group: System Environment/Libraries +# Requires: %%{_cross_name}-libgcc = %%{version}-%%{release} +# Provides: %%{_cross_name}-libatomic = %%{version}-%%{release} + +# %%description -n libgcc-atomic +# The libgcc package contains GCC shared libraries for atomic counter updates. + +# %%package -n libgcc-devel +# Summary: GNU C Library +# Group: Development/Libraries +# Requires: %%{_cross_name}-libgcc = %%{version}-%%{release} + +# %%description -n libgcc-devel +# The libgcc package contains GCC shared libraries for gcc . +# This package contains development headers and static library for libgcc. + +# %%package c++ +# Summary: C++ support for GCC +# Group: System Environment/Libraries +# Requires: %%{_cross_name}-gcc = %%{version}-%%{release} +# Requires: %%{_cross_name}-libstdc++-devel = %%{version}-%%{release} +# Provides: %%{_cross_name}-gcc-g++ = %%{version}-%%{release} +# Provides: %%{_cross_name}-g++ = %%{version}-%%{release} + +# %%description c++ +# This package adds C++ support to the GNU Compiler Collection. +# It includes support for most of the current C++ specification, +# including templates and exception handling. + +# %%package -n libstdc++ +# Summary: GNU C Library +# Group: System Environment/Libraries +# Requires: %%{_cross_name}-libgcc = %%{version}-%%{release} + +# %%description -n libstdc++ +# This package contains the GCC Standard C++ Library v3, an ongoing project to implement the ISO/IEC 14882:1998 Standard C++ library. + +# %%package -n libstdc++-devel +# Summary: GNU C Library +# Group: Development/Libraries +# Requires: %%{_cross_name}-libstdc++ = %%{version}-%%{release} +# Provides: %%{_cross_name}-libstdc++-static = %%{version}-%%{release} + +# %%description -n libstdc++-devel +# This is the GNU implementation of the standard C++ libraries. +# This package includes the headers files and libraries needed for C++ development. + +# %%package -n libgomp +# Summary: GNU C Library +# Group: System Environment/Libraries + +# %%description -n libgomp +# An implementation of OpenMP for the C, C++, and Fortran 95 compilers in the GNU Compiler Collection. + +# %%package -n libgomp-devel +# Summary: Development headers and static library for libgomp +# Group: Development/Libraries +# Requires: %%{_cross_name}-libgomp = %%{version}-%%{release} + +# %%description -n libgomp-devel +# An implementation of OpenMP for the C, C++, and Fortran 95 compilers in the GNU Compiler Collection. +# This package contains development headers and static library for libgomp + +%prep +%setup -q -n gcc-%{version} +# disable no-pie for gcc binaries +sed -i '/^NO_PIE_CFLAGS = /s/@NO_PIE_CFLAGS@//' gcc/Makefile.in + +install -vdm 755 %{_builddir}/%{name}-build +cd %{_builddir} +tar -xf %{SOURCE1} +ln -s mpfr-4.1.0 gcc-%{version}/mpfr +tar -xf %{SOURCE2} +ln -s gmp-6.2.1 gcc-%{version}/gmp +tar -xf %{SOURCE3} +ln -s mpc-1.2.1 gcc-%{version}/mpc + +cp mpfr-4.1.0/COPYING gcc-%{version}/COPYING-mpfr +cp gmp-6.2.1/COPYING gcc-%{version}/COPYING-gmp +cp mpc-1.2.1/COPYING.LESSER gcc-%{version}/COPYING.LESSER-mpc + +%build +# What flags do we want here? Clearing with '%%global set_build_flags %%{nil}' at start of file. +#CFLAGS="`echo " %%{build_cflags} " | sed 's/-Werror=format-security/-Wno-error=format-security/'`" +#CXXFLAGS="`echo " %%{build_cxxflags} " | sed 's/-Werror=format-security/-Wno-error=format-security/'`" + +# export glibcxx_cv_c99_math_cxx98=yes glibcxx_cv_c99_math_cxx11=yes +# SED=sed \ + +# Ideally we would like to model this after the %%configure macro in the future. +cd %{_builddir}/%{name}-build +../gcc-%{version}/configure \ + --prefix=%{_cross_prefix} \ + --target=%{_tuple} \ + --disable-multilib \ + --enable-shared \ + --enable-threads=posix \ + --enable-__cxa_atexit \ + --enable-clocale=gnu \ + --enable-languages=c,c++,fortran \ + --disable-bootstrap \ + --enable-linker-build-id \ + --enable-plugin \ + --enable-default-pie \ + --with-sysroot=%{_cross_sysroot} \ + --with-native-system-header-dir=%{_includedir} +make %{?_smp_mflags} all-gcc + +%install +cd %{_builddir}/%{name}-build +make %{?_smp_mflags} DESTDIR=%{buildroot} install-gcc + +find %{buildroot} -name '*.la' -delete +rm -rf %{buildroot}%{_cross_prefix}%{_infodir} +cd ../gcc-%{version} +%find_lang %{name} --all-name + +# Turning off so we don't get ldconfig errors for crossarch packages +# Add the /opt/cross libs to the ldcache +# mkdir -p %%{buildroot}%%{_sysconfdir}/ld.so.conf.d/ +# echo %%{buildroot}%%{_sysconfdir}/ld.so.conf.d/%%{name}.conf +# cat > %%{buildroot}%%{_sysconfdir}/ld.so.conf.d/%%{name}.conf < - 11.2.0-2 +- Update to 11.2.0-2 + +* Fri Feb 12 2021 Daniel McIlvaney - 9.1.0-11 +- Fork normal gcc package into cross compile aware boot strap package + +* Fri Jan 08 2021 Ruying Chen - 9.1.0-10 +- Provide libquadmath and libquadmath-devel. + +* Tue Nov 03 2020 Joe Schmitt - 9.1.0-9 +- Provide gcc-plugin-devel. + +* Mon Sep 28 2020 Ruying Chen 9.1.0-8 +- Split gcc-c++ subpackage. +- Provide cpp, gcc-gfortran, libatomic, and listdc++-static. + +* Thu Sep 10 2020 Thomas Crain - 9.1.0-7 +- Ignore CVE-2019-15847, as it applies to an unsupported ISA + +* Mon Jul 06 2020 Henry Beberman - 9.1.0-6 +- Comment out with_check BuildRequires to break circular dependency in build graph. + +* Thu Jun 11 2020 Henry Beberman - 9.1.0-5 +- Disable -Werror=format-security to build with hardened cflags + +* Sat May 09 00:21:12 PST 2020 Nick Samson - 9.1.0-4 +- Added %%license line automatically + +* Thu Apr 30 2020 Emre Girgin - 9.1.0-3 +- Renaming mpc to libmpc + +* Thu Apr 09 2020 Emre Girgin - 9.1.0-2 +- Add the "--enable-default-pie" flag in order to enforce ASLR-enabled binaries. + +* Tue Mar 17 2020 Andrew Phelps - 9.1.0-1 +- Update to version 9.1.0. License verified. Add libstdc++fs.a + +* Tue Jan 21 2020 Andrew Phelps - 7.3.0-6 +- Fixing build issues for multiple architectures + +* Tue Sep 03 2019 Mateusz Malisz - 7.3.0-5 +- Initial CBL-Mariner import from Photon (license: Apache2). + +* Fri Nov 02 2018 Alexey Makhalov - 7.3.0-4 +- Use nofortify security_hardening instead of sed hacking +- Use %configure + +* Wed Sep 19 2018 Alexey Makhalov - 7.3.0-3 +- Fix compilation issue for glibc-2.28 + +* Thu Aug 30 2018 Keerthana K - 7.3.0-2 +- Packaging .a files (libstdc++-static files). + +* Wed Aug 01 2018 Srivatsa S. Bhat - 7.3.0-1 +- Update to version 7.3.0 to get retpoline support. + +* Tue Nov 14 2017 Alexey Makhalov - 6.3.0-7 +- Aarch64 support + +* Mon Oct 02 2017 Alexey Makhalov - 6.3.0-6 +- Added smp_mflags for parallel build + +* Mon Sep 25 2017 Alexey Makhalov - 6.3.0-5 +- Enable elfdeps for libgcc_s to generate libgcc_s.so.1(*)(64bit) provides + +* Mon Aug 28 2017 Alexey Makhalov - 6.3.0-4 +- Fix makecheck + +* Tue Aug 15 2017 Alexey Makhalov - 6.3.0-3 +- Fix compilation issue for glibc-2.26 + +* Tue Aug 15 2017 Alexey Makhalov - 6.3.0-2 +- Improve make check + +* Thu Mar 9 2017 Alexey Makhalov - 6.3.0-1 +- Update version to 6.3 + +* Thu Mar 02 2017 Xiaolin Li - 5.3.0-6 +- Enabled fortran. + +* Wed Feb 22 2017 Alexey Makhalov - 5.3.0-5 +- Added new plugin entry point: PLUGIN_TYPE_CAST (.patch) + +* Thu Sep 8 2016 Alexey Makhalov - 5.3.0-4 +- Enable plugins and linker build id. + +* Tue May 24 2016 Priyesh Padmavilasom - 5.3.0-3 +- GA - Bump release of all rpms + +* Tue May 17 2016 Anish Swaminathan - 5.3.0-2 +- Change package dependencies + +* Mon Mar 28 2016 Alexey Makhalov - 5.3.0-1 +- Update version to 5.3 + +* Tue Nov 10 2015 Xiaolin Li - 4.8.2-6 +- Handled locale files with macro find_lang + +* Mon Nov 02 2015 Vinay Kulkarni - 4.8.2-5 +- Put libatomic.so into its own package. + +* Wed May 20 2015 Touseef Liaqat - 4.8.2-4 +- Updated group. + +* Mon May 18 2015 Touseef Liaqat - 4.8.2-3 +- Update according to UsrMove. + +* Fri May 15 2015 Divya Thaluru - 4.8.2-2 +- Packaging .la files + +* Tue Apr 01 2014 baho-utot - 4.8.2-1 +- Initial build. First version diff --git a/SPECS/cross-gcc-bootstrap/cross-gcc-bootstrap2.signatures.json b/SPECS/cross-gcc-bootstrap/cross-gcc-bootstrap2.signatures.json new file mode 100644 index 00000000000..4e95a01bc8d --- /dev/null +++ b/SPECS/cross-gcc-bootstrap/cross-gcc-bootstrap2.signatures.json @@ -0,0 +1,8 @@ +{ + "Signatures": { + "gcc-11.2.0.tar.xz": "d08edc536b54c372a1010ff6619dd274c0f1603aa49212ba20f7aa2cda36fa8b", + "gmp-6.2.1.tar.xz": "fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2", + "mpc-1.2.1.tar.gz": "17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459", + "mpfr-4.1.0.tar.xz": "0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f" + } + } \ No newline at end of file diff --git a/SPECS/cross-gcc-bootstrap/cross-gcc-bootstrap2.spec b/SPECS/cross-gcc-bootstrap/cross-gcc-bootstrap2.spec new file mode 100644 index 00000000000..11d1ba54546 --- /dev/null +++ b/SPECS/cross-gcc-bootstrap/cross-gcc-bootstrap2.spec @@ -0,0 +1,444 @@ +%global security_hardening nofortify +%global debug_package %{nil} +%global set_build_flags %{nil} + +# Globals which should be in a macro file. +# These should be set programatically in the future. +%global _host_arch x86_64 +%global _target_arch aarch64 + +%global _tuple %{_target_arch}-%{_vendor}-linux-gnu +%global _cross_name %{_target_arch}-%{_vendor}-linux-gnu + +# Folders which should be in our macro file +%global _opt /opt/ +%global _crossdir /opt/cross/ + +# Generally we include '/usr' in most paths. +# Can we also use '/usr' for our paths? This will bring us in line with the +# %%configure macro which sets these. +%global _bindir /bin +%global _sbindir /sbin +%global _libdir /lib +%global _lib64dir /lib64 +%global _libexecdir /libexec +%global _datadir /share +%global _docdir /share/doc +%global _includedir /include +%global _infodir /share/info +%global _mandir /share/man +%global _oldincludedir /include + +# If we want our cross compile aware packges to also support native, we +# need logic to switch modes something like this: +%if "%{_target_arch}" != "%{_host_arch}" +%global _cross_prefix %{_crossdir}%{_tuple}/ +%global _cross_sysroot %{_crossdir}%{_tuple}/sysroot/ +%global _cross_includedir /usr/%{_host}/%{_tuple}/include/ +%global _cross_infodir %{_crossdir}%{_tuple}/share/info +%global _cross_bindir %{_tuple}/bin +%global _cross_libdir %{_tuple}/lib +%global _tuple_name %{_tuple}- + +%global __strip %{_cross_prefix}%{_bindir}/%{_tuple_name}strip +%global __objdump %{_cross_prefix}%{_bindir}/%{_tuple_name}objdump +%else +%global _cross_prefix %{nil} +%global _cross_sysroot %{nil} +%global _cross_includedir %{_includedir} +%global _cross_infodir %{_infodir} +%global _cross_bindir %{_bindir} +%global _cross_libdir %{_libdir} +%global _tuple_name %{nil} +%endif + +Summary: Contains the GNU compiler collection +Name: %{_cross_name}-gcc-bootstrap2 +Version: 11.2.0 +Release: 2%{?dist} +License: GPLv2+ +Vendor: Microsoft Corporation +Distribution: Mariner +Group: Development/Tools +URL: https://gcc.gnu.org/ +Source0: https://ftp.gnu.org/gnu/gcc/%{name}-%{version}/gcc-%{version}.tar.xz +Source1: https://ftp.gnu.org/gnu/mpfr/mpfr-4.1.0.tar.xz +Source2: http://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.xz +Source3: https://ftp.gnu.org/gnu/mpc/mpc-1.2.1.tar.gz + +BuildRequires: %{_cross_name}-binutils +BuildRequires: %{_cross_name}-kernel-headers +BuildRequires: %{_cross_name}-glibc-bootstrap +AutoReqProv: no +ExclusiveArch: x86_64 +Conflicts: %{_cross_name}-cross-gcc +#%%if %%{with_check} +#BuildRequires: autogen +#BuildRequires: dejagnu +#%%endif + +#Merge all of the packages for the bootstrap packages +# (Only gfortran, c++ sub packages are built for bootstrap 1) + +%description +The GCC package contains the GNU compiler collection, +which includes the C and C++ compilers. + +# %%package -n gfortran +# Summary: GNU Fortran compiler. +# Group: Development/Tools +# Requires: %%{_cross_name}-gcc = %%{version}-%%{release} +# Provides: %%{_cross_name}-gcc-gfortran = %%{version}-%%{release} + +# %%description -n gfortran +# The gfortran package contains GNU Fortran compiler. + +# %%package -n libgcc +# Summary: GNU C Library +# Group: System Environment/Libraries + +# %%description -n libgcc +# The libgcc package contains GCC shared libraries for gcc. + +# %%package -n libgcc-atomic +# Summary: GNU C Library for atomic counter updates +# Group: System Environment/Libraries +# Requires: %%{_cross_name}-libgcc = %%{version}-%%{release} +# Provides: %%{_cross_name}-libatomic = %%{version}-%%{release} + +# %%description -n libgcc-atomic +# The libgcc package contains GCC shared libraries for atomic counter updates. + +# %%package -n libgcc-devel +# Summary: GNU C Library +# Group: Development/Libraries +# Requires: %%{_cross_name}-libgcc = %%{version}-%%{release} + +# %%description -n libgcc-devel +# The libgcc package contains GCC shared libraries for gcc . +# This package contains development headers and static library for libgcc. + +# %%package c++ +# Summary: C++ support for GCC +# Group: System Environment/Libraries +# Requires: %%{_cross_name}-gcc = %%{version}-%%{release} +# Requires: %%{_cross_name}-libstdc++-devel = %%{version}-%%{release} +# Provides: %%{_cross_name}-gcc-g++ = %%{version}-%%{release} +# Provides: %%{_cross_name}-g++ = %%{version}-%%{release} + +# %%description c++ +# This package adds C++ support to the GNU Compiler Collection. +# It includes support for most of the current C++ specification, +# including templates and exception handling. + +# %%package -n libstdc++ +# Summary: GNU C Library +# Group: System Environment/Libraries +# Requires: %%{_cross_name}-libgcc = %%{version}-%%{release} + +# %%description -n libstdc++ +# This package contains the GCC Standard C++ Library v3, an ongoing project to implement the ISO/IEC 14882:1998 Standard C++ library. + +# %%package -n libstdc++-devel +# Summary: GNU C Library +# Group: Development/Libraries +# Requires: %%{_cross_name}-libstdc++ = %%{version}-%%{release} +# Provides: %%{_cross_name}-libstdc++-static = %%{version}-%%{release} + +# %%description -n libstdc++-devel +# This is the GNU implementation of the standard C++ libraries. +# This package includes the headers files and libraries needed for C++ development. + +# %%package -n libgomp +# Summary: GNU C Library +# Group: System Environment/Libraries + +# %%description -n libgomp +# An implementation of OpenMP for the C, C++, and Fortran 95 compilers in the GNU Compiler Collection. + +# %%package -n libgomp-devel +# Summary: Development headers and static library for libgomp +# Group: Development/Libraries +# Requires: %%{_cross_name}-libgomp = %%{version}-%%{release} + +# %%description -n libgomp-devel +# An implementation of OpenMP for the C, C++, and Fortran 95 compilers in the GNU Compiler Collection. +# This package contains development headers and static library for libgomp + +%prep +%setup -q -n gcc-%{version} +# disable no-pie for gcc binaries +sed -i '/^NO_PIE_CFLAGS = /s/@NO_PIE_CFLAGS@//' gcc/Makefile.in + +install -vdm 755 %{_builddir}/%{name}-build +cd %{_builddir} +tar -xf %{SOURCE1} +ln -s mpfr-4.1.0 gcc-%{version}/mpfr +tar -xf %{SOURCE2} +ln -s gmp-6.2.1 gcc-%{version}/gmp +tar -xf %{SOURCE3} +ln -s mpc-1.2.1 gcc-%{version}/mpc + +cp mpfr-4.1.0/COPYING gcc-%{version}/COPYING-mpfr +cp gmp-6.2.1/COPYING gcc-%{version}/COPYING-gmp +cp mpc-1.2.1/COPYING.LESSER gcc-%{version}/COPYING.LESSER-mpc + +%build +# What flags do we want here? Clearing with '%%global set_build_flags %%{nil}' at start of file. +#CFLAGS="`echo " %%{build_cflags} " | sed 's/-Werror=format-security/-Wno-error=format-security/'`" +#CXXFLAGS="`echo " %%{build_cxxflags} " | sed 's/-Werror=format-security/-Wno-error=format-security/'`" + +# export glibcxx_cv_c99_math_cxx98=yes glibcxx_cv_c99_math_cxx11=yes +# SED=sed \ + +TEMP_SYSROOT="%{_builddir}/temp_sysroot/" +cp -r "%{_cross_sysroot}" "$TEMP_SYSROOT" +# This should reference our %%{_includedir} probably? Why the missmatch between /include and /usr/include? +mkdir -p "$TEMP_SYSROOT/usr" +ln -s "../include" "$TEMP_SYSROOT/usr/include" + +# Ideally we would like to model this after the %%configure macro in the future. +cd %{_builddir}/%{name}-build +../gcc-%{version}/configure \ + --prefix=%{_cross_prefix} \ + --target=%{_tuple} \ + --disable-multilib \ + --enable-shared \ + --enable-threads=posix \ + --enable-__cxa_atexit \ + --enable-clocale=gnu \ + --enable-languages=c,c++,fortran \ + --disable-bootstrap \ + --enable-linker-build-id \ + --enable-plugin \ + --enable-default-pie \ + --with-sysroot=%{_cross_sysroot} \ + --with-build-sysroot="$TEMP_SYSROOT" + +make %{?_smp_mflags} all-target-libgcc + +%install +cd %{_builddir}/%{name}-build +make %{?_smp_mflags} DESTDIR=%{buildroot} install-target-libgcc + +find %{buildroot} -name '*.la' -delete +rm -rf %{buildroot}%{_cross_prefix}%{_infodir} +# Only creates a few libraries, no translations etc. +# cd ../gcc-%{version} +# %find_lang %{name} --all-name + +# Turning off so we don't get ldconfig errors for crossarch packages +# Add the /opt/cross libs to the ldcache +# mkdir -p %%{buildroot}%%{_sysconfdir}/ld.so.conf.d/ +# echo %%{buildroot}%%{_sysconfdir}/ld.so.conf.d/%%{name}.conf +# cat > %%{buildroot}%%{_sysconfdir}/ld.so.conf.d/%%{name}.conf < - 11.2.0-2 +- Update to 11.2.0-2 + +* Fri Feb 12 2021 Daniel McIlvaney - 9.1.0-11 +- Fork normal gcc package into cross compile aware boot strap package + +* Fri Jan 08 2021 Ruying Chen - 9.1.0-10 +- Provide libquadmath and libquadmath-devel. + +* Tue Nov 03 2020 Joe Schmitt - 9.1.0-9 +- Provide gcc-plugin-devel. + +* Mon Sep 28 2020 Ruying Chen 9.1.0-8 +- Split gcc-c++ subpackage. +- Provide cpp, gcc-gfortran, libatomic, and listdc++-static. + +* Thu Sep 10 2020 Thomas Crain - 9.1.0-7 +- Ignore CVE-2019-15847, as it applies to an unsupported ISA + +* Mon Jul 06 2020 Henry Beberman - 9.1.0-6 +- Comment out with_check BuildRequires to break circular dependency in build graph. + +* Thu Jun 11 2020 Henry Beberman - 9.1.0-5 +- Disable -Werror=format-security to build with hardened cflags + +* Sat May 09 00:21:12 PST 2020 Nick Samson - 9.1.0-4 +- Added %%license line automatically + +* Thu Apr 30 2020 Emre Girgin - 9.1.0-3 +- Renaming mpc to libmpc + +* Thu Apr 09 2020 Emre Girgin - 9.1.0-2 +- Add the "--enable-default-pie" flag in order to enforce ASLR-enabled binaries. + +* Tue Mar 17 2020 Andrew Phelps - 9.1.0-1 +- Update to version 9.1.0. License verified. Add libstdc++fs.a + +* Tue Jan 21 2020 Andrew Phelps - 7.3.0-6 +- Fixing build issues for multiple architectures + +* Tue Sep 03 2019 Mateusz Malisz - 7.3.0-5 +- Initial CBL-Mariner import from Photon (license: Apache2). + +* Fri Nov 02 2018 Alexey Makhalov - 7.3.0-4 +- Use nofortify security_hardening instead of sed hacking +- Use %configure + +* Wed Sep 19 2018 Alexey Makhalov - 7.3.0-3 +- Fix compilation issue for glibc-2.28 + +* Thu Aug 30 2018 Keerthana K - 7.3.0-2 +- Packaging .a files (libstdc++-static files). + +* Wed Aug 01 2018 Srivatsa S. Bhat - 7.3.0-1 +- Update to version 7.3.0 to get retpoline support. + +* Tue Nov 14 2017 Alexey Makhalov - 6.3.0-7 +- Aarch64 support + +* Mon Oct 02 2017 Alexey Makhalov - 6.3.0-6 +- Added smp_mflags for parallel build + +* Mon Sep 25 2017 Alexey Makhalov - 6.3.0-5 +- Enable elfdeps for libgcc_s to generate libgcc_s.so.1(*)(64bit) provides + +* Mon Aug 28 2017 Alexey Makhalov - 6.3.0-4 +- Fix makecheck + +* Tue Aug 15 2017 Alexey Makhalov - 6.3.0-3 +- Fix compilation issue for glibc-2.26 + +* Tue Aug 15 2017 Alexey Makhalov - 6.3.0-2 +- Improve make check + +* Thu Mar 9 2017 Alexey Makhalov - 6.3.0-1 +- Update version to 6.3 + +* Thu Mar 02 2017 Xiaolin Li - 5.3.0-6 +- Enabled fortran. + +* Wed Feb 22 2017 Alexey Makhalov - 5.3.0-5 +- Added new plugin entry point: PLUGIN_TYPE_CAST (.patch) + +* Thu Sep 8 2016 Alexey Makhalov - 5.3.0-4 +- Enable plugins and linker build id. + +* Tue May 24 2016 Priyesh Padmavilasom - 5.3.0-3 +- GA - Bump release of all rpms + +* Tue May 17 2016 Anish Swaminathan - 5.3.0-2 +- Change package dependencies + +* Mon Mar 28 2016 Alexey Makhalov - 5.3.0-1 +- Update version to 5.3 + +* Tue Nov 10 2015 Xiaolin Li - 4.8.2-6 +- Handled locale files with macro find_lang + +* Mon Nov 02 2015 Vinay Kulkarni - 4.8.2-5 +- Put libatomic.so into its own package. + +* Wed May 20 2015 Touseef Liaqat - 4.8.2-4 +- Updated group. + +* Mon May 18 2015 Touseef Liaqat - 4.8.2-3 +- Update according to UsrMove. + +* Fri May 15 2015 Divya Thaluru - 4.8.2-2 +- Packaging .la files + +* Tue Apr 01 2014 baho-utot - 4.8.2-1 +- Initial build. First version diff --git a/SPECS/cross-gcc-bootstrap/cross-gcc-bootstrap3.signatures.json b/SPECS/cross-gcc-bootstrap/cross-gcc-bootstrap3.signatures.json new file mode 100644 index 00000000000..4e95a01bc8d --- /dev/null +++ b/SPECS/cross-gcc-bootstrap/cross-gcc-bootstrap3.signatures.json @@ -0,0 +1,8 @@ +{ + "Signatures": { + "gcc-11.2.0.tar.xz": "d08edc536b54c372a1010ff6619dd274c0f1603aa49212ba20f7aa2cda36fa8b", + "gmp-6.2.1.tar.xz": "fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2", + "mpc-1.2.1.tar.gz": "17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459", + "mpfr-4.1.0.tar.xz": "0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f" + } + } \ No newline at end of file diff --git a/SPECS/cross-gcc-bootstrap/cross-gcc-bootstrap3.spec b/SPECS/cross-gcc-bootstrap/cross-gcc-bootstrap3.spec new file mode 100644 index 00000000000..bcf2585aa7c --- /dev/null +++ b/SPECS/cross-gcc-bootstrap/cross-gcc-bootstrap3.spec @@ -0,0 +1,448 @@ +%global security_hardening nofortify +%global debug_package %{nil} +%global set_build_flags %{nil} +%define __os_install_post %{nil} +%global _unpackaged_files_terminate_build 0 + +# Globals which should be in a macro file. +# These should be set programatically in the future. +%global _host_arch x86_64 +%global _target_arch aarch64 + +%global _tuple %{_target_arch}-%{_vendor}-linux-gnu +%global _cross_name %{_target_arch}-%{_vendor}-linux-gnu + +# Folders which should be in our macro file +%global _opt /opt/ +%global _crossdir /opt/cross/ + +# Generally we include '/usr' in most paths. +# Can we also use '/usr' for our paths? This will bring us in line with the +# %%configure macro which sets these. +%global _bindir /bin +%global _sbindir /sbin +%global _libdir /lib +%global _lib64dir /lib64 +%global _libexecdir /libexec +%global _datadir /share +%global _docdir /share/doc +%global _includedir /include +%global _infodir /share/info +%global _mandir /share/man +%global _oldincludedir /include + +# If we want our cross compile aware packges to also support native, we +# need logic to switch modes something like this: +%if "%{_target_arch}" != "%{_host_arch}" +%global _cross_prefix %{_crossdir}%{_tuple}/ +%global _cross_sysroot %{_crossdir}%{_tuple}/sysroot/ +%global _cross_includedir /usr/%{_host}/%{_tuple}/include/ +%global _cross_infodir %{_crossdir}%{_tuple}/share/info +%global _cross_bindir %{_tuple}/bin +%global _cross_libdir %{_tuple}/lib +%global _tuple_name %{_tuple}- + +%global __strip %{_cross_prefix}%{_bindir}/%{_tuple_name}strip +%global __objdump %{_cross_prefix}%{_bindir}/%{_tuple_name}objdump +%else +%global _cross_prefix %{nil} +%global _cross_sysroot %{nil} +%global _cross_includedir %{_includedir} +%global _cross_infodir %{_infodir} +%global _cross_bindir %{_bindir} +%global _cross_libdir %{_libdir} +%global _tuple_name %{nil} +%endif + +Summary: Contains the GNU compiler collection +Name: %{_cross_name}-gcc-bootstrap3 +Version: 11.2.0 +Release: 2%{?dist} +License: GPLv2+ +Vendor: Microsoft Corporation +Distribution: Mariner +Group: Development/Tools +URL: https://gcc.gnu.org/ +Source0: https://ftp.gnu.org/gnu/gcc/%{name}-%{version}/gcc-%{version}.tar.xz +Source1: https://ftp.gnu.org/gnu/mpfr/mpfr-4.1.0.tar.xz +Source2: http://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.xz +Source3: https://ftp.gnu.org/gnu/mpc/mpc-1.2.1.tar.gz + +BuildRequires: %{_cross_name}-binutils +BuildRequires: %{_cross_name}-kernel-headers +BuildRequires: %{_cross_name}-glibc-bootstrap2 +AutoReqProv: no +ExclusiveArch: x86_64 +Conflicts: %{_cross_name}-cross-gcc +Conflicts: %{_cross_name}-gcc-bootstrap +Conflicts: %{_cross_name}-gcc-bootstrap2 +#%%if %%{with_check} +#BuildRequires: autogen +#BuildRequires: dejagnu +#%%endif + +#Merge all of the packages for the bootstrap packages +# (Only gfortran, c++ sub packages are built for bootstrap 1) + +%description +The GCC package contains the GNU compiler collection, +which includes the C and C++ compilers. + +# %%package -n gfortran +# Summary: GNU Fortran compiler. +# Group: Development/Tools +# Requires: %%{_cross_name}-gcc = %%{version}-%%{release} +# Provides: %%{_cross_name}-gcc-gfortran = %%{version}-%%{release} + +# %%description -n gfortran +# The gfortran package contains GNU Fortran compiler. + +# %%package -n libgcc +# Summary: GNU C Library +# Group: System Environment/Libraries + +# %%description -n libgcc +# The libgcc package contains GCC shared libraries for gcc. + +# %%package -n libgcc-atomic +# Summary: GNU C Library for atomic counter updates +# Group: System Environment/Libraries +# Requires: %%{_cross_name}-libgcc = %%{version}-%%{release} +# Provides: %%{_cross_name}-libatomic = %%{version}-%%{release} + +# %%description -n libgcc-atomic +# The libgcc package contains GCC shared libraries for atomic counter updates. + +# %%package -n libgcc-devel +# Summary: GNU C Library +# Group: Development/Libraries +# Requires: %%{_cross_name}-libgcc = %%{version}-%%{release} + +# %%description -n libgcc-devel +# The libgcc package contains GCC shared libraries for gcc . +# This package contains development headers and static library for libgcc. + +# %%package c++ +# Summary: C++ support for GCC +# Group: System Environment/Libraries +# Requires: %%{_cross_name}-gcc = %%{version}-%%{release} +# Requires: %%{_cross_name}-libstdc++-devel = %%{version}-%%{release} +# Provides: %%{_cross_name}-gcc-g++ = %%{version}-%%{release} +# Provides: %%{_cross_name}-g++ = %%{version}-%%{release} + +# %%description c++ +# This package adds C++ support to the GNU Compiler Collection. +# It includes support for most of the current C++ specification, +# including templates and exception handling. + +# %%package -n libstdc++ +# Summary: GNU C Library +# Group: System Environment/Libraries +# Requires: %%{_cross_name}-libgcc = %%{version}-%%{release} + +# %%description -n libstdc++ +# This package contains the GCC Standard C++ Library v3, an ongoing project to implement the ISO/IEC 14882:1998 Standard C++ library. + +# %%package -n libstdc++-devel +# Summary: GNU C Library +# Group: Development/Libraries +# Requires: %%{_cross_name}-libstdc++ = %%{version}-%%{release} +# Provides: %%{_cross_name}-libstdc++-static = %%{version}-%%{release} + +# %%description -n libstdc++-devel +# This is the GNU implementation of the standard C++ libraries. +# This package includes the headers files and libraries needed for C++ development. + +# %%package -n libgomp +# Summary: GNU C Library +# Group: System Environment/Libraries + +# %%description -n libgomp +# An implementation of OpenMP for the C, C++, and Fortran 95 compilers in the GNU Compiler Collection. + +# %%package -n libgomp-devel +# Summary: Development headers and static library for libgomp +# Group: Development/Libraries +# Requires: %%{_cross_name}-libgomp = %%{version}-%%{release} + +# %%description -n libgomp-devel +# An implementation of OpenMP for the C, C++, and Fortran 95 compilers in the GNU Compiler Collection. +# This package contains development headers and static library for libgomp + +%prep +%setup -q -n gcc-%{version} +# disable no-pie for gcc binaries +sed -i '/^NO_PIE_CFLAGS = /s/@NO_PIE_CFLAGS@//' gcc/Makefile.in + +install -vdm 755 %{_builddir}/%{name}-build +cd %{_builddir} +tar -xf %{SOURCE1} +ln -s mpfr-4.1.0 gcc-%{version}/mpfr +tar -xf %{SOURCE2} +ln -s gmp-6.2.1 gcc-%{version}/gmp +tar -xf %{SOURCE3} +ln -s mpc-1.2.1 gcc-%{version}/mpc + +cp mpfr-4.1.0/COPYING gcc-%{version}/COPYING-mpfr +cp gmp-6.2.1/COPYING gcc-%{version}/COPYING-gmp +cp mpc-1.2.1/COPYING.LESSER gcc-%{version}/COPYING.LESSER-mpc + +%build +# What flags do we want here? Clearing with '%%global set_build_flags %%{nil}' at start of file. +# #CFLAGS="`echo " %%{build_cflags} " | sed 's/-Werror=format-security/-Wno-error=format-security/'`" +# #CXXFLAGS="`echo " %%{build_cxxflags} " | sed 's/-Werror=format-security/-Wno-error=format-security/'`" + +#export glibcxx_cv_c99_math_cxx98=yes glibcxx_cv_c99_math_cxx11=yes +#SED=sed \ + +TEMP_SYSROOT="%{_builddir}/temp_sysroot/" +cp -r "%{_cross_sysroot}" "$TEMP_SYSROOT" +# This should reference our %%{_includedir} probably? Why the missmatch between /include and /usr/include? +mkdir -p "$TEMP_SYSROOT/usr" +ln -s "../include" "$TEMP_SYSROOT/usr/include" + +# Ideally we would like to model this after the %%configure macro in the future. +cd %{_builddir}/%{name}-build +../gcc-%{version}/configure \ + --cache-file=/dev/null \ + --prefix=%{_cross_prefix} \ + --target=%{_tuple} \ + --disable-multilib \ + --enable-shared \ + --enable-threads=posix \ + --enable-__cxa_atexit \ + --enable-clocale=gnu \ + --enable-languages=c,c++,fortran \ + --disable-bootstrap \ + --enable-linker-build-id \ + --enable-plugin \ + --enable-default-pie \ + --with-sysroot=%{_cross_sysroot} \ + --with-build-sysroot="$TEMP_SYSROOT" + +make %{?_smp_mflags} + +%install +cd %{_builddir}/%{name}-build +make %{?_smp_mflags} DESTDIR=%{buildroot} install + +find %{buildroot} -name '*.la' -delete +rm -rf %{buildroot}%{_cross_prefix}%{_infodir} +cd ../gcc-%{version} +%find_lang %{name} --all-name + +# Turning off so we don't get ldconfig errors for crossarch packages +# Add the /opt/cross libs to the ldcache +# mkdir -p %%{buildroot}%%{_sysconfdir}/ld.so.conf.d/ +# echo %%{buildroot}%%{_sysconfdir}/ld.so.conf.d/%%{name}.conf +# cat > %%{buildroot}%%{_sysconfdir}/ld.so.conf.d/%%{name}.conf < - 11.2.0-2 +- Update to 11.2.0-2 + +* Fri Feb 12 2021 Daniel McIlvaney - 9.1.0-11 +- Fork normal gcc package into cross compile aware boot strap package + +* Fri Jan 08 2021 Ruying Chen - 9.1.0-10 +- Provide libquadmath and libquadmath-devel. + +* Tue Nov 03 2020 Joe Schmitt - 9.1.0-9 +- Provide gcc-plugin-devel. + +* Mon Sep 28 2020 Ruying Chen 9.1.0-8 +- Split gcc-c++ subpackage. +- Provide cpp, gcc-gfortran, libatomic, and listdc++-static. + +* Thu Sep 10 2020 Thomas Crain - 9.1.0-7 +- Ignore CVE-2019-15847, as it applies to an unsupported ISA + +* Mon Jul 06 2020 Henry Beberman - 9.1.0-6 +- Comment out with_check BuildRequires to break circular dependency in build graph. + +* Thu Jun 11 2020 Henry Beberman - 9.1.0-5 +- Disable -Werror=format-security to build with hardened cflags + +* Sat May 09 00:21:12 PST 2020 Nick Samson - 9.1.0-4 +- Added %%license line automatically + +* Thu Apr 30 2020 Emre Girgin - 9.1.0-3 +- Renaming mpc to libmpc + +* Thu Apr 09 2020 Emre Girgin - 9.1.0-2 +- Add the "--enable-default-pie" flag in order to enforce ASLR-enabled binaries. + +* Tue Mar 17 2020 Andrew Phelps - 9.1.0-1 +- Update to version 9.1.0. License verified. Add libstdc++fs.a + +* Tue Jan 21 2020 Andrew Phelps - 7.3.0-6 +- Fixing build issues for multiple architectures + +* Tue Sep 03 2019 Mateusz Malisz - 7.3.0-5 +- Initial CBL-Mariner import from Photon (license: Apache2). + +* Fri Nov 02 2018 Alexey Makhalov - 7.3.0-4 +- Use nofortify security_hardening instead of sed hacking +- Use %configure + +* Wed Sep 19 2018 Alexey Makhalov - 7.3.0-3 +- Fix compilation issue for glibc-2.28 + +* Thu Aug 30 2018 Keerthana K - 7.3.0-2 +- Packaging .a files (libstdc++-static files). + +* Wed Aug 01 2018 Srivatsa S. Bhat - 7.3.0-1 +- Update to version 7.3.0 to get retpoline support. + +* Tue Nov 14 2017 Alexey Makhalov - 6.3.0-7 +- Aarch64 support + +* Mon Oct 02 2017 Alexey Makhalov - 6.3.0-6 +- Added smp_mflags for parallel build + +* Mon Sep 25 2017 Alexey Makhalov - 6.3.0-5 +- Enable elfdeps for libgcc_s to generate libgcc_s.so.1(*)(64bit) provides + +* Mon Aug 28 2017 Alexey Makhalov - 6.3.0-4 +- Fix makecheck + +* Tue Aug 15 2017 Alexey Makhalov - 6.3.0-3 +- Fix compilation issue for glibc-2.26 + +* Tue Aug 15 2017 Alexey Makhalov - 6.3.0-2 +- Improve make check + +* Thu Mar 9 2017 Alexey Makhalov - 6.3.0-1 +- Update version to 6.3 + +* Thu Mar 02 2017 Xiaolin Li - 5.3.0-6 +- Enabled fortran. + +* Wed Feb 22 2017 Alexey Makhalov - 5.3.0-5 +- Added new plugin entry point: PLUGIN_TYPE_CAST (.patch) + +* Thu Sep 8 2016 Alexey Makhalov - 5.3.0-4 +- Enable plugins and linker build id. + +* Tue May 24 2016 Priyesh Padmavilasom - 5.3.0-3 +- GA - Bump release of all rpms + +* Tue May 17 2016 Anish Swaminathan - 5.3.0-2 +- Change package dependencies + +* Mon Mar 28 2016 Alexey Makhalov - 5.3.0-1 +- Update version to 5.3 + +* Tue Nov 10 2015 Xiaolin Li - 4.8.2-6 +- Handled locale files with macro find_lang + +* Mon Nov 02 2015 Vinay Kulkarni - 4.8.2-5 +- Put libatomic.so into its own package. + +* Wed May 20 2015 Touseef Liaqat - 4.8.2-4 +- Updated group. + +* Mon May 18 2015 Touseef Liaqat - 4.8.2-3 +- Update according to UsrMove. + +* Fri May 15 2015 Divya Thaluru - 4.8.2-2 +- Packaging .la files + +* Tue Apr 01 2014 baho-utot - 4.8.2-1 +- Initial build. First version diff --git a/SPECS/cross-gcc-bootstrap/gcc.signatures.json b/SPECS/cross-gcc-bootstrap/gcc.signatures.json new file mode 100644 index 00000000000..b1f7a3cb911 --- /dev/null +++ b/SPECS/cross-gcc-bootstrap/gcc.signatures.json @@ -0,0 +1,5 @@ +{ + "Signatures": { + "gcc-9.1.0.tar.xz": "79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0" + } +} \ No newline at end of file diff --git a/SPECS/cross-gcc/cross-gcc.spec b/SPECS/cross-gcc/cross-gcc.spec new file mode 100644 index 00000000000..b8866ac919a --- /dev/null +++ b/SPECS/cross-gcc/cross-gcc.spec @@ -0,0 +1,161 @@ +%global debug_package %{nil} +%global __os_install_post %{nil} + +# Globals which should be in a macro file. +# These should be set programatically in the future. +%global _host_arch x86_64 +%global _target_arch aarch64 + +%global _tuple %{_target_arch}-%{_vendor}-linux-gnu +%global _cross_name %{_target_arch}-%{_vendor}-linux-gnu + +# Folders which should be in our macro file +%global _opt /opt/ +%global _crossdir /opt/cross/ + +# Generally we include '/usr' in most paths. +# Can we also use '/usr' for our paths? This will bring us in line with the +# %%configure macro which sets these. +%global _bindir /bin +%global _sbindir /sbin +%global _libdir /lib +%global _lib64dir /lib64 +%global _libexecdir /libexec +%global _datadir /share +%global _docdir /share/doc +%global _includedir /include +%global _infodir /share/info +%global _mandir /share/man +%global _oldincludedir /include + +# If we want our cross compile aware packges to also support native, we +# need logic to switch modes something like this: +%if "%{_target_arch}" != "%{_host_arch}" +%global _cross_prefix %{_crossdir}%{_tuple}/ +%global _cross_sysroot %{_crossdir}%{_tuple}/sysroot/ +%global _cross_includedir /usr/%{_host}/%{_tuple}/include/ +%global _cross_infodir %{_crossdir}%{_tuple}/share/info +%global _cross_bindir %{_tuple}/bin +%global _cross_libdir %{_tuple}/lib +%global _tuple_name %{_tuple}- + +%global __strip %{_cross_prefix}%{_bindir}/%{_tuple_name}strip +%global __objdump %{_cross_prefix}%{_bindir}/%{_tuple_name}objdump +%else +%global _cross_prefix %{nil} +%global _cross_sysroot %{nil} +%global _cross_includedir %{_includedir} +%global _cross_infodir %{_infodir} +%global _cross_bindir %{_bindir} +%global _cross_libdir %{_libdir} +%global _tuple_name %{nil} +%endif + +Summary: Contains the GNU compiler collection, binutils, glibc, kernel headers +Name: %{_cross_name}-cross-gcc +Version: 0.1.0 +Release: 1%{?dist} +License: GPLv2+ +Vendor: Microsoft Corporation +Distribution: Mariner +Group: Development/Tools +BuildRequires: %{_cross_name}-binutils +BuildRequires: %{_cross_name}-kernel-headers +BuildRequires: %{_cross_name}-glibc-bootstrap2 +BuildRequires: %{_cross_name}-gcc-bootstrap3 +BuildRequires: grep +AutoReqProv: no +ExclusiveArch: x86_64 +Conflicts: %{_cross_name}-gcc-bootstrap +Conflicts: %{_cross_name}-gcc-bootstrap2 +Conflicts: %{_cross_name}-gcc-bootstrap3 +Conflicts: %{_cross_name}-glibc-bootstrap +Conflicts: %{_cross_name}-glibc-bootstrap2 +Conflicts: %{_cross_name}-kernel-headers +Requires: libmpc + +%description +Bundle of all files needed to cross compile with gcc including: gcc, glibc, binutils, kernel headers. + +%build +# Find all non-license files and place in a manifest. +rpm -ql %{_cross_name}-binutils %{_cross_name}-kernel-headers %{_cross_name}-glibc-bootstrap2 %{_cross_name}-gcc-bootstrap3 | \ + grep --invert-match "%{_datadir}/licenses/" | \ + sort --unique > %{_cross_name}-file_manifest_with_dirs.txt + +# Find all the license files, append a package specific name, and place them in a new license folder +# ie +# "/share/licenses/aarch64-mariner-linux-gnu-glibc-bootstrap2-2.28/LICENSES" +# becomes: +# "./licenses/glibc-LICENSES" + +install -vdm 755 %{_builddir}/licenses +#binutils +for license in $(rpm -qL %{_cross_name}-binutils); do + new_name=binutils-$(basename ${license}) + cp ${license} ./licenses/${new_name} +done +#kernel-headers +for license in $(rpm -qL %{_cross_name}-kernel-headers); do + new_name=kernel-headers-$(basename ${license}) + cp ${license} ./licenses/${new_name} +done +#glibc +for license in $(rpm -qL %{_cross_name}-glibc-bootstrap2); do + new_name=glibc-$(basename ${license}) + cp ${license} ./licenses/${new_name} +done +#gcc +for license in $(rpm -qL %{_cross_name}-gcc-bootstrap3); do + new_name=gcc-$(basename ${license}) + cp ${license} ./licenses/${new_name} +done + +ls ./licenses/ + +%install +for source_file in $(cat %{_cross_name}-file_manifest_with_dirs.txt | sort --unique); do + target_file=%{buildroot}/${source_file} + target_dir=$(dirname ${target_file}) + ls ${target_file} || true + if [ -f ${target_file} -o -d ${target_file} ]; then + echo "skipping file which already exists: '${target_file}'" + else + mkdir -p ${target_dir} + cp -r ${source_file} ${target_file} + fi + + # Create a new manifest which does not claim ownership of any directories (avoids "file listed twice" warnings) + if [ ! -d "${source_file}" ]; then + echo "${source_file}" >> %{_cross_name}-file_manifest.txt + fi +done +install -D %{_cross_name}-file_manifest.txt %{buildroot}/%{_cross_prefix}/%{_cross_name}-file_manifest.txt + +# Create a symlink from sysroot/usr/include to sysroot/include +# The GCC toolchain will look for header files under sysroot/usr/include +mkdir -p %{buildroot}/%{_cross_sysroot}/usr +ln -s "../include" %{buildroot}/%{_cross_sysroot}/usr + +# Turning off so we don't get ldconfig errors for crossarch packages +# Add the /opt/cross libs to the ldcache +# mkdir -p %%{buildroot}%%{_sysconfdir}/ld.so.conf.d/ +# echo %%{buildroot}%%{_sysconfdir}/ld.so.conf.d/%%{name}.conf +# cat > %%{buildroot}%%{_sysconfdir}/ld.so.conf.d/%%{name}.conf < - 0.1.0-1 +- Initial version for Mariner diff --git a/SPECS/cross-glibc-bootstrap/CVE-2018-20796.nopatch b/SPECS/cross-glibc-bootstrap/CVE-2018-20796.nopatch new file mode 100644 index 00000000000..e69de29bb2d diff --git a/SPECS/cross-glibc-bootstrap/CVE-2019-6488.nopatch b/SPECS/cross-glibc-bootstrap/CVE-2019-6488.nopatch new file mode 100644 index 00000000000..e69de29bb2d diff --git a/SPECS/cross-glibc-bootstrap/CVE-2020-1751.nopatch b/SPECS/cross-glibc-bootstrap/CVE-2020-1751.nopatch new file mode 100644 index 00000000000..e69de29bb2d diff --git a/SPECS/cross-glibc-bootstrap/CVE-2020-6096.nopatch b/SPECS/cross-glibc-bootstrap/CVE-2020-6096.nopatch new file mode 100644 index 00000000000..e69de29bb2d diff --git a/SPECS/cross-glibc-bootstrap/cross-glibc-bootstrap.signatures.json b/SPECS/cross-glibc-bootstrap/cross-glibc-bootstrap.signatures.json new file mode 100644 index 00000000000..89b3c7de608 --- /dev/null +++ b/SPECS/cross-glibc-bootstrap/cross-glibc-bootstrap.signatures.json @@ -0,0 +1,7 @@ +{ + "Signatures": { + "glibc-2.35.tar.xz": "5123732f6b67ccd319305efd399971d58592122bcc2a6518a1bd2510dd0cf52e", + "locale-gen.conf": "94182ce116a42e38ce783d2a867dca1eaf4d6a347d4bff9aac4d6e61cbbfc8f4", + "locale-gen.sh": "df7169cb9f126875e0a57a4700261e16e6eba2a98312d739f972377150ba9964" + } +} \ No newline at end of file diff --git a/SPECS/cross-glibc-bootstrap/cross-glibc-bootstrap.spec b/SPECS/cross-glibc-bootstrap/cross-glibc-bootstrap.spec new file mode 100644 index 00000000000..dc69ffdfea2 --- /dev/null +++ b/SPECS/cross-glibc-bootstrap/cross-glibc-bootstrap.spec @@ -0,0 +1,472 @@ +%global security_hardening nonow +%define glibc_target_cpu %{_target_arch} +%define debug_package %{nil} + +# Globals which should be in a macro file. +# These should be set programatically in the future. +%global _host_arch x86_64 +%global _target_arch aarch64 + +%global _tuple %{_target_arch}-%{_vendor}-linux-gnu +%global _cross_name %{_target_arch}-%{_vendor}-linux-gnu + +# Folders which should be in our macro file +%global _opt /opt/ +%global _crossdir /opt/cross/ + +# Generally we include '/usr' in most paths. +# Can we also use '/usr' for our paths? This will bring us in line with the +# %%configure macro which sets these. +%global _bindir /bin +%global _sbindir /sbin +%global _libdir /lib +%global _lib64dir /lib64 +%global _libexecdir /libexec +%global _datadir /share +%global _docdir /share/doc +%global _includedir /include +%global _infodir /share/info +%global _mandir /share/man +%global _oldincludedir /include + +# If we want our cross compile aware packges to also support native, we +# need logic to switch modes something like this: +%if "%{_target_arch}" != "%{_host_arch}" +%global _cross_prefix %{_crossdir}%{_tuple}/ +%global _cross_sysroot %{_crossdir}%{_tuple}/sysroot/ +%global _cross_includedir /usr/%{_host}/%{_tuple}/include/ +%global _cross_infodir %{_crossdir}%{_tuple}/share/info +%global _cross_bindir %{_tuple}/bin +%global _cross_libdir %{_tuple}/lib +%global _tuple_name %{_tuple}- + +%global __strip %{_cross_prefix}%{_bindir}/%{_tuple_name}strip +%else +%global _cross_prefix %{nil} +%global _cross_sysroot %{nil} +%global _cross_includedir %{_includedir} +%global _cross_infodir %{_infodir} +%global _cross_bindir %{_bindir} +%global _cross_libdir %{_libdir} +%global _tuple_name %{nil} +%endif + +Summary: Main C library +Name: %{_cross_name}-glibc-bootstrap +Version: 2.35 +Release: 2%{?dist} +License: LGPLv2+ +Vendor: Microsoft Corporation +Distribution: Mariner +Group: Applications/System +URL: https://www.gnu.org/software/libc +Source0: https://ftp.gnu.org/gnu/glibc/glibc-%{version}.tar.xz +Patch0: http://www.linuxfromscratch.org/patches/downloads/glibc/glibc-2.35-fhs-1.patch +Patch1: CVE-2020-6096.nopatch +Patch2: CVE-2019-6488.nopatch + +Patch3: CVE-2020-1751.nopatch +Patch4: CVE-2018-20796.nopatch +Patch5: glibc-2.34_pthread_cond_wait.patch + +#Requires: filesystem +Provides: %{name}-common = %{version}-%{release} +Provides: %{_cross_name}-rtld(GNU_HASH) +Provides: %{_crossdir}%{_tuple}/sbin/ldconfig +BuildRequires: %{_cross_name}-binutils +BuildRequires: %{_cross_name}-kernel-headers +BuildRequires: %{_cross_name}-gcc-bootstrap +AutoReqProv: no +ExclusiveArch: x86_64 +Conflicts: %{_cross_name}-glibc +Conflicts: %{_cross_name}-glibc-bootstrap +Conflicts: %{_cross_name}-cross-gcc +ExcludeArch: armv7 ppc i386 i686 + +%description +This library provides the basic routines for allocating memory, +searching directories, opening and closing files, reading and +writing files, string handling, pattern matching, arithmetic, +and so on. + +#Merge all of the packages for the bootstrap packages + +# %%package devel +# Summary: Header files for glibc +# Group: Applications/System +# Requires: %%{name} = %%{version}-%%{release} +# Provides: %%{name}-headers = %%{version}-%%{release} +# Provides: %%{name}-static = %%{version}-%%{release} +# Provides: %%{name}-static%%{?_isa} = %%{version}-%%{release} + +# %%description devel +# These are the header files of glibc. + +# %%package lang +# Summary: Additional language files for glibc +# Group: Applications/System +# Requires: %%{name} = %%{version}-%%{release} + +# %%description lang +# These are the additional language files of glibc. + +# %%package i18n +# Summary: Additional internationalization files for glibc +# Group: Applications/System +# Requires: %%{name} = %%{version}-%%{release} + +# %%description i18n +# These are the additional internationalization files of glibc. + +# %%package iconv +# Summary: gconv modules for glibc +# Group: Applications/System +# Requires: %%{name} = %%{version}-%%{release} + +# %%description iconv +# These are gconv modules for iconv(). + +# %%package tools +# Summary: tools for glibc +# Group: Applications/System +# Requires: %%{name} = %%{version}-%%{release} + +# %%description tools +# Extra tools for glibc. + +# %%package nscd +# Summary: Name Service Cache Daemon +# Group: Applications/System +# Requires: %%{name} = %%{version}-%%{release} + +# %%description nscd +# Name Service Cache Daemon + +%prep +%setup -q -n glibc-%{version} +sed -i 's/\\$$(pwd)/`pwd`/' timezone/Makefile +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 + +install -vdm 755 %{_builddir}/%{name}-build +# do not try to explicitly provide GLIBC_PRIVATE versioned libraries +%define __find_provides %{_builddir}/%{name}-%{version}/find_provides.sh +%define __find_requires %{_builddir}/%{name}-%{version}/find_requires.sh + +# create find-provides and find-requires script in order to ignore GLIBC_PRIVATE errors +cat > find_provides.sh << _EOF +#! /bin/sh +if [ -d /tools ]; then +/tools/lib/rpm/find-provides | grep -v GLIBC_PRIVATE +else +%{_lib}/rpm/find-provides | grep -v GLIBC_PRIVATE +fi +exit 0 +_EOF +chmod +x find_provides.sh + +cat > find_requires.sh << _EOF +#! /bin/sh +if [ -d /tools ]; then +/tools/lib/rpm/find-requires %{buildroot} %{glibc_target_cpu} | grep -v GLIBC_PRIVATE +else +%{_lib}/rpm/find-requires %{buildroot} %{glibc_target_cpu} | grep -v GLIBC_PRIVATE +fi +_EOF +chmod +x find_requires.sh +#___EOF + +%build +# What flags do we want here? +CFLAGS="" +CXXFLAGS="" +#CFLAGS="`echo " %%{build_cflags} " | sed 's/-Wp,-D_FORTIFY_SOURCE=2//'`" +#CXXFLAGS="`echo " %%{build_cxxflags} " | sed 's/-Wp,-D_FORTIFY_SOURCE=2//'`" +export CFLAGS +export CXXFLAGS + +# Need to make some temp directories to put files into, we don't want to polute our +# build machines directores and we shouldn't be touching BUILDROOT yet. +TEMP_SYSROOT="%{_builddir}/temp_sysroot/" +cp -r "%{_cross_sysroot}" "$TEMP_SYSROOT" + +export PATH="%{_cross_prefix}%{_bindir}":$PATH + +cd %{_builddir}/%{name}-build +../glibc-%{version}/configure \ + --prefix=/ \ + --build=%{_host_arch}-%{_vendor}-linux-gnu \ + --host=%{_tuple} \ + --target=%{_tuple} \ + --with-sysroot="$TEMP_SYSROOT" \ + --with-headers="$TEMP_SYSROOT/%{_includedir}" \ + --disable-multilib \ + libc_cv_forced_unwind=yes \ + libc_cv_ctors_header=yes \ + --disable-werror \ + --enable-languages=c,c++ + +make %{?_smp_mflags} DESTDIR=$TEMP_SYSROOT install-bootstrap-headers=yes install-headers +make %{?_smp_mflags} csu/subdir_lib +# Depending on the state of the sysroot, /lib may already exist +mkdir -p "$TEMP_SYSROOT/%{_libdir}" +install csu/crt1.o csu/crti.o csu/crtn.o "$TEMP_SYSROOT/%{_libdir}" +%{_cross_name}-gcc -nostdlib -nostartfiles -shared -x c /dev/null -o "$TEMP_SYSROOT%{_libdir}/libc.so" + +# Sometimes we have false "out of memory" make error +# just rerun/continue make to workaroung it. +#make %%{?_smp_mflags} || make %%{?_smp_mflags} || make %%{?_smp_mflags} + +%install +cd %{_builddir}/%{name}-build +make %{?_smp_mflags} DESTDIR="%{buildroot}%{_cross_sysroot}" install-bootstrap-headers=yes install-headers +touch %{buildroot}%{_cross_sysroot}%{_includedir}/gnu/stubs.h +mkdir %{buildroot}%{_cross_sysroot}/%{_libdir} +install csu/crt1.o csu/crti.o csu/crtn.o ../temp_sysroot/%{_libdir}/libc.so %{buildroot}%{_cross_sysroot}/%{_libdir} + +# # Do not remove static libs +# pushd %%{_builddir}/glibc-build +# # Create directories +# make install_root=%%{buildroot} install +# install -vdm 755 %%{buildroot}%%{_sysconfdir}/ld.so.conf.d +# install -vdm 755 %%{buildroot}%%{_var}/cache/nscd +# install -vdm 755 %%{buildroot}%%{_libdir}/locale +# cp -v ../%%{name}-%%{version}/nscd/nscd.conf %%{buildroot}%%{_sysconfdir}/nscd.conf +# # Install locale generation script and config file +# cp -v %%{SOURCE2} %%{buildroot}%%{_sysconfdir} +# cp -v %%{SOURCE1} %%{buildroot}/sbin +# # Remove unwanted cruft +# rm -rf %%{buildroot}%%{_infodir} +# # Install configuration files + +# Spaces should not be used in nsswitch.conf in the begining of new line +# Only tab should be used as it expects the same in source code. +# Otherwise "altfiles" will not be added. which may cause dbus.service failure +# cat > %{buildroot}%{_sysconfdir}/nsswitch.conf <<- "EOF" +# # Begin /etc/nsswitch.conf + +# passwd: files +# group: files +# shadow: files + +# hosts: files dns +# networks: files + +# protocols: files +# services: files +# ethers: files +# rpc: files +# # End /etc/nsswitch.conf +# EOF +# cat > %{buildroot}%{_sysconfdir}/ld.so.conf <<- "EOF" +# # Begin /etc/ld.so.conf +# %{_prefix}/local/lib +# /opt/lib +# include %{_sysconfdir}/ld.so.conf.d/*.conf +# EOF +# popd +#%find_lang %{name} --all-name +# pushd localedata +# # Generate out of locale-archive an (en_US.) UTF-8 locale +# mkdir -p %{buildroot}%{_lib}/locale +# I18NPATH=. GCONV_PATH=../../glibc-build/iconvdata LC_ALL=C ../../glibc-build/locale/localedef --no-archive --prefix=%{buildroot} -A ../intl/locale.alias -i locales/en_US -c -f charmaps/UTF-8 en_US.UTF-8 +# mv %{buildroot}%{_lib}/locale/en_US.utf8 %{buildroot}%{_lib}/locale/en_US.UTF-8 +# popd +# to do not depend on /bin/bash +# sed -i 's@#! /bin/bash@#! /bin/sh@' %{buildroot}%{_bindir}/ldd +# sed -i 's@#!/bin/bash@#!/bin/sh@' %{buildroot}%{_bindir}/tzselect + +# %check +# cd %{_builddir}/glibc-build +# make %{?_smp_mflags} check ||: +# # These 2 persistant false positives are OK +# # XPASS for: elf/tst-protected1a and elf/tst-protected1b +# [ `grep ^XPASS tests.sum | wc -l` -ne 2 -a `grep "^XPASS: elf/tst-protected1[ab]" tests.sum | wc -l` -ne 2 ] && exit 1 ||: + +# # FAIL (intermittent) in chroot but PASS in container: +# # posix/tst-spawn3 and stdio-common/test-vfprintf +# n=0 +# grep "^FAIL: posix/tst-spawn3" tests.sum >/dev/null && n=$((n+1)) ||: +# grep "^FAIL: stdio-common/test-vfprintf" tests.sum >/dev/null && n=$((n+1)) ||: +# # FAIL always on overlayfs/aufs (in container) +# grep "^FAIL: posix/tst-dir" tests.sum >/dev/null && n=$((n+1)) ||: + +# #https://sourceware.org/glibc/wiki/Testing/Testsuite +# grep "^FAIL: nptl/tst-eintr1" tests.sum >/dev/null && n=$((n+1)) ||: +# #This happens because the kernel fails to reap exiting threads fast enough, +# #eventually resulting an EAGAIN when pthread_create is called within the test. + +# # check for exact 'n' failures +# [ `grep ^FAIL tests.sum | wc -l` -ne $n ] && exit 1 ||: + +# %post -p /sbin/ldconfig +# %postun -p /sbin/ldconfig + +%files +%defattr(-,root,root) +%license LICENSES +%{_cross_sysroot}%{_libdir}/*.so +%{_cross_sysroot}%{_libdir}/*.o +%{_cross_sysroot}%{_includedir}/* + +%changelog +* Thu Dec 15 2022 Dallas Delaney - 2.35-2 +- Update to 2.35-2 + +* Thu Dec 10 2020 Joe Schmitt - 2.28-14 +- Provide isa version of glibc-static. + +* Mon Sep 28 2020 Ruying Chen - 2.28-13 +- Move some tools from glibc-tools and glibc-iconv to glibc and provide glibc-common +- Provide glibc-static and glibc-headers under glibc-devel + +* Wed Jul 29 2020 Thomas Crain - 2.28-12 +- Ignore CVE-2018-20796, as it is not a security issue + +* Wed Jul 29 2020 Emre Girgin - 2.28-11 +- Disable the debuginfo package for glibc, and use unstripped binaries instead. + +* Fri Jun 26 2020 Ruying Chen - 2.28-10 +- Added provides for binary capability. + +* Thu Jun 11 2020 Henry Beberman - 2.28-9 +- Disable -Wp,-D_FORTIFY_SOURCE=2 to build with hardened cflags. + +* Tue May 19 2020 Emre Girgin - 2.28-8 +- Ignore CVE-2019-6488, CVE-2020-1751, CVE-2020-6096 as they don't apply to aarch64 or x86_64. + +* Sat May 09 2020 Nick Samson - 2.28-7 +- Added %%license line automatically + +* Fri Mar 20 2020 Andrew Phelps - 2.28-6 +- Configure with --disable-werror. + +* Mon Dec 02 2019 Saravanan Somasundaram - 2.28-5 +- Initial CBL-Mariner import from Photon (license: Apache2). + +* Fri Jul 12 2019 Ankit Jain - 2.28-4 +- Replaced spaces with tab in nsswitch.conf file + +* Fri Mar 08 2019 Alexey Makhalov - 2.28-3 +- Fix CVE-2019-9169 + +* Tue Jan 22 2019 Anish Swaminathan - 2.28-2 +- Fix CVE-2018-19591 + +* Tue Aug 28 2018 Alexey Makhalov - 2.28-1 +- Version update. Disable obsolete rpc (use libtirpc) and nsl. + +* Tue Jan 23 2018 Xiaolin Li - 2.26-10 +- Fix CVE-2018-1000001 and CVE-2018-6485 + +* Mon Jan 08 2018 Xiaolin Li - 2.26-9 +- Fix CVE-2017-16997 + +* Thu Dec 21 2017 Xiaolin Li - 2.26-8 +- Fix CVE-2017-17426 + +* Tue Nov 14 2017 Alexey Makhalov - 2.26-7 +- Aarch64 support + +* Wed Oct 25 2017 Xiaolin Li - 2.26-6 +- Fix CVE-2017-15670 and CVE-2017-15804 + +* Tue Oct 10 2017 Alexey Makhalov - 2.26-5 +- Compile out tcache. + +* Fri Sep 15 2017 Bo Gan - 2.26-4 +- exclude tst-eintr1 per official wiki recommendation. + +* Tue Sep 12 2017 Alexey Makhalov - 2.26-3 +- Fix makecheck for run in docker. + +* Tue Aug 29 2017 Alexey Makhalov - 2.26-2 +- Fix tunables setter. +- Add malloc arena fix. +- Fix makecheck. + +* Tue Aug 15 2017 Alexey Makhalov - 2.26-1 +- Version update + +* Tue Aug 08 2017 Anish Swaminathan - 2.25-4 +- Apply fix for CVE-2017-1000366 + +* Thu May 4 2017 Bo Gan - 2.25-3 +- Remove bash dependency in post/postun script + +* Fri Apr 21 2017 Alexey Makhalov - 2.25-2 +- Added -iconv -tools and -nscd subpackages + +* Wed Mar 22 2017 Alexey Makhalov - 2.25-1 +- Version update + +* Wed Dec 14 2016 Alexey Makhalov - 2.24-1 +- Version update + +* Wed Nov 23 2016 Alexey Makhalov - 2.22-13 +- Install en_US.UTF-8 locale by default + +* Wed Nov 16 2016 Alexey Makhalov - 2.22-12 +- Added i18n subpackage + +* Tue Oct 25 2016 Alexey Makhalov - 2.22-11 +- Workaround for build failure with "out of memory" message + +* Wed Sep 28 2016 Alexey Makhalov - 2.22-10 +- Added pthread_create-fix-use-after-free.patch + +* Tue Jun 14 2016 Divya Thaluru - 2.22-9 +- Enabling rpm debug package and stripping the libraries + +* Tue May 24 2016 Priyesh Padmavilasom - 2.22-8 +- GA - Bump release of all rpms + +* Mon May 23 2016 Divya Thaluru - 2.22-7 +- Added patch for CVE-2014-9761 + +* Mon Mar 21 2016 Alexey Makhalov - 2.22-6 +- Security hardening: nonow + +* Fri Mar 18 2016 Anish Swaminathan - 2.22-5 +- Change conf file qualifiers + +* Fri Mar 11 2016 Priyesh Padmavilasom - 2.22-4 +- Added patch for res_qeury assertion with bad dns config +- Details: https://sourceware.org/bugzilla/show_bug.cgi?id=19791 + +* Tue Feb 16 2016 Anish Swaminathan - 2.22-3 +- Added patch for CVE-2015-7547 + +* Mon Feb 08 2016 Anish Swaminathan - 2.22-2 +- Added patch for bindresvport blacklist + +* Tue Jan 12 2016 Xiaolin Li - 2.22-1 +- Updated to version 2.22 + +* Tue Dec 1 2015 Divya Thaluru - 2.19-8 +- Disabling rpm debug package and stripping the libraries + +* Wed Nov 18 2015 Divya Thaluru - 2.19-7 +- Adding patch to close nss files database + +* Tue Nov 10 2015 Xiaolin Li - 2.19-6 +- Handled locale files with macro find_lang + +* Wed Aug 05 2015 Kumar Kaushik - 2.19-5 +- Adding postun section for ldconfig. + +* Tue Jul 28 2015 Alexey Makhalov - 2.19-4 +- Support glibc building against current rpm version. + +* Thu Jul 23 2015 Divya Thaluru - 2.19-3 +- Packing locale-gen scripts + +* Mon May 18 2015 Touseef Liaqat - 2.19-2 +- Update according to UsrMove. + +* Wed Nov 5 2014 Divya Thaluru - 2.19-1 +- Initial build. First version diff --git a/SPECS/cross-glibc-bootstrap/cross-glibc-bootstrap2.signatures.json b/SPECS/cross-glibc-bootstrap/cross-glibc-bootstrap2.signatures.json new file mode 100644 index 00000000000..89b3c7de608 --- /dev/null +++ b/SPECS/cross-glibc-bootstrap/cross-glibc-bootstrap2.signatures.json @@ -0,0 +1,7 @@ +{ + "Signatures": { + "glibc-2.35.tar.xz": "5123732f6b67ccd319305efd399971d58592122bcc2a6518a1bd2510dd0cf52e", + "locale-gen.conf": "94182ce116a42e38ce783d2a867dca1eaf4d6a347d4bff9aac4d6e61cbbfc8f4", + "locale-gen.sh": "df7169cb9f126875e0a57a4700261e16e6eba2a98312d739f972377150ba9964" + } +} \ No newline at end of file diff --git a/SPECS/cross-glibc-bootstrap/cross-glibc-bootstrap2.spec b/SPECS/cross-glibc-bootstrap/cross-glibc-bootstrap2.spec new file mode 100644 index 00000000000..b14e6806301 --- /dev/null +++ b/SPECS/cross-glibc-bootstrap/cross-glibc-bootstrap2.spec @@ -0,0 +1,570 @@ +%global security_hardening nonow +%define glibc_target_cpu %{_target_arch} +%define debug_package %{nil} +%define __requires_exclude ^/(bin|usr/bin).*$ + +# Globals which should be in a macro file. +# These should be set programatically in the future. +%global _host_arch x86_64 +%global _target_arch aarch64 + +%global _tuple %{_target_arch}-%{_vendor}-linux-gnu +%global _cross_name %{_target_arch}-%{_vendor}-linux-gnu + +# Folders which should be in our macro file +%global _opt /opt/ +%global _crossdir /opt/cross/ + +# Generally we include '/usr' in most paths. +# Can we also use '/usr' for our paths? This will bring us in line with the +# %%configure macro which sets these. +%global _bindir /bin +%global _sbindir /sbin +%global _libdir /lib +%global _lib64dir /lib64 +%global _libexecdir /libexec +%global _datadir /share +%global _docdir /share/doc +%global _includedir /include +%global _infodir /share/info +%global _mandir /share/man +%global _oldincludedir /include + +# If we want our cross compile aware packges to also support native, we +# need logic to switch modes something like this: +%if "%{_target_arch}" != "%{_host_arch}" +%global _cross_prefix %{_crossdir}%{_tuple}/ +%global _cross_sysroot %{_crossdir}%{_tuple}/sysroot/ +%global _cross_includedir /usr/%{_host}/%{_tuple}/include/ +%global _cross_infodir %{_crossdir}%{_tuple}/share/info +%global _cross_bindir %{_tuple}/bin +%global _cross_libdir %{_tuple}/lib +%global _tuple_name %{_tuple}- + +%global __strip %{_cross_prefix}%{_bindir}/%{_tuple_name}strip +%else +%global _cross_prefix %{nil} +%global _cross_sysroot %{nil} +%global _cross_includedir %{_includedir} +%global _cross_infodir %{_infodir} +%global _cross_bindir %{_bindir} +%global _cross_libdir %{_libdir} +%global _tuple_name %{nil} +%endif + +Summary: Main C library +Name: %{_cross_name}-glibc-bootstrap2 +Version: 2.35 +Release: 2%{?dist} +License: LGPLv2+ +Vendor: Microsoft Corporation +Distribution: Mariner +Group: Applications/System +URL: https://www.gnu.org/software/libc +Source0: https://ftp.gnu.org/gnu/glibc/glibc-%{version}.tar.xz +Patch0: http://www.linuxfromscratch.org/patches/downloads/glibc/glibc-2.35-fhs-1.patch +Patch1: CVE-2020-6096.nopatch +Patch2: CVE-2019-6488.nopatch + +Patch3: CVE-2020-1751.nopatch +Patch4: CVE-2018-20796.nopatch +Patch5: glibc-2.34_pthread_cond_wait.patch + +#Requires: filesystem +Provides: %{name}-common = %{version}-%{release} +Provides: %{_cross_name}-rtld(GNU_HASH) +Provides: %{_crossdir}%{_tuple}/sbin/ldconfig +BuildRequires: %{_cross_name}-binutils +BuildRequires: %{_cross_name}-kernel-headers +BuildRequires: %{_cross_name}-gcc-bootstrap +BuildRequires: %{_cross_name}-gcc-bootstrap2 +BuildRequires: perl(File::Find) +AutoReqProv: no +ExclusiveArch: x86_64 +Conflicts: %{_cross_name}-glibc +Conflicts: %{_cross_name}-glibc-bootstrap2 +Conflicts: %{_cross_name}-cross-gcc +ExcludeArch: armv7 ppc i386 i686 + +%description +This library provides the basic routines for allocating memory, +searching directories, opening and closing files, reading and +writing files, string handling, pattern matching, arithmetic, +and so on. + +#Merge all of the packages for the bootstrap packages + +# %%package devel +# Summary: Header files for glibc +# Group: Applications/System +# Requires: %%{name} = %%{version}-%%{release} +# Provides: %%{name}-headers = %%{version}-%%{release} +# Provides: %%{name}-static = %%{version}-%%{release} +# Provides: %%{name}-static%%{?_isa} = %%{version}-%%{release} + +# %%description devel +# These are the header files of glibc. + +# %%package lang +# Summary: Additional language files for glibc +# Group: Applications/System +# Requires: %%{name} = %%{version}-%%{release} + +# %%description lang +# These are the additional language files of glibc. + +# %%package i18n +# Summary: Additional internationalization files for glibc +# Group: Applications/System +# Requires: %%{name} = %%{version}-%%{release} + +# %%description i18n +# These are the additional internationalization files of glibc. + +# %%package iconv +# Summary: gconv modules for glibc +# Group: Applications/System +# Requires: %%{name} = %%{version}-%%{release} + +# %%description iconv +# These are gconv modules for iconv(). + +# %%package tools +# Summary: tools for glibc +# Group: Applications/System +# Requires: %%{name} = %%{version}-%%{release} + +# %%description tools +# Extra tools for glibc. + +# %%package nscd +# Summary: Name Service Cache Daemon +# Group: Applications/System +# Requires: %%{name} = %%{version}-%%{release} + +# %%description nscd +# Name Service Cache Daemon + +%prep +%setup -q -n glibc-%{version} +sed -i 's/\\$$(pwd)/`pwd`/' timezone/Makefile +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 + +install -vdm 755 %{_builddir}/%{name}-build + +# Don't need these since we aren't doing generators? +# do not try to explicitly provide GLIBC_PRIVATE versioned libraries +# %define __find_provides %{_builddir}/%{name}-%%{version}/find_provides.sh +# %define __find_requires %{_builddir}/%{name}-%%{version}/find_requires.sh + +# # create find-provides and find-requires script in order to ignore GLIBC_PRIVATE errors +# cat > find_provides.sh << _EOF +# #! /bin/sh +# if [ -d /tools ]; then +# /tools/lib/rpm/find-provides | grep -v GLIBC_PRIVATE +# else +# %%{_lib}/rpm/find-provides | grep -v GLIBC_PRIVATE +# fi +# exit 0 +# _EOF +# chmod +x find_provides.sh + +# cat > find_requires.sh << _EOF +# #! /bin/sh +# if [ -d /tools ]; then +# /tools/lib/rpm/find-requires %{buildroot} %%{glibc_target_cpu} | grep -v GLIBC_PRIVATE +# else +# %{_lib}/rpm/find-requires %{buildroot} %%{glibc_target_cpu} | grep -v GLIBC_PRIVATE +# fi +# _EOF +# chmod +x find_requires.sh +# #___EOF + +%build +# What flags do we want here? +CFLAGS="" +CXXFLAGS="" +#CFLAGS="`echo " %%{build_cflags} " | sed 's/-Wp,-D_FORTIFY_SOURCE=2//'`" +#CXXFLAGS="`echo " %%{build_cxxflags} " | sed 's/-Wp,-D_FORTIFY_SOURCE=2//'`" +export CFLAGS +export CXXFLAGS +LDFLAGS="`echo " %{build_ldflags} " | sed 's#-Wl,-dT,%{_topdir}/BUILD/module_info.ld##'`" +export LDFLAGS + +# Need to make some temp directories to put files into, we don't want to polute our +# build machines directores and we shouldn't be touching BUILDROOT yet. +TEMP_SYSROOT="%{_builddir}/temp_sysroot/" +cp -r "%{_cross_sysroot}" "$TEMP_SYSROOT" + +export PATH="%{_cross_prefix}%{_bindir}":$PATH + +cd %{_builddir}/%{name}-build +../glibc-%{version}/configure \ + --prefix=/ \ + --build=%{_host_arch}-%{_vendor}-linux-gnu \ + --host=%{_tuple} \ + --with-sysroot="$TEMP_SYSROOT" \ + --with-headers="$TEMP_SYSROOT/%{_includedir}" \ + --disable-multilib \ + libc_cv_forced_unwind=yes \ + libc_cv_ctors_header=yes \ + --disable-werror \ + --enable-languages=c,c++ \ + libc_cv_c_cleanup=yes \ + CXX=aarch64-mariner-linux-gnu-gcc + +make %{?_smp_mflags} DESTDIR=$TEMP_SYSROOT + +# Sometimes we have false "out of memory" make error +# just rerun/continue make to workaroung it. +#make %%{?_smp_mflags} || make %%{?_smp_mflags} || make %%{?_smp_mflags} + +%install +export PATH="%{_cross_prefix}%{_bindir}":$PATH +cd %{_builddir}/%{name}-build +make %{?_smp_mflags} DESTDIR="%{buildroot}%{_cross_sysroot}" install + +# # Do not remove static libs +# # Create directories +# make install_root=%%{buildroot} install + +# We probably don't want configs in our sysroot? +# install -vdm 755 %{buildroot}%{_sysconfdir}/ld.so.conf.d +# install -vdm 755 %{buildroot}%{_var}/cache/nscd +# install -vdm 755 %{buildroot}%{_libdir}/locale +# cp -v ../glibc-%{version}/nscd/nscd.conf %{buildroot}%{_cross_sysroot}%{_sysconfdir}/nscd.conf + +# Install locale generation script and config file +# Omitting locale, will need to include sources for this from base spec +# cp -v %%{SOURCE2} %%{buildroot}%%{_sysconfdir} +# cp -v %%{SOURCE1} %%{buildroot}/sbin + +# Remove unwanted cruft +find %{buildroot} -name '*.la' -delete +rm -rf %{buildroot}%{_cross_sysroot}%{_infodir} +# Install configuration files + +# # Spaces should not be used in nsswitch.conf in the begining of new line +# # Only tab should be used as it expects the same in source code. +# # Otherwise "altfiles" will not be added. which may cause dbus.service failure +# cat > %{buildroot}%{_sysconfdir}/nsswitch.conf <<- "EOF" +# # Begin /etc/nsswitch.conf + +# passwd: files +# group: files +# shadow: files + +# hosts: files dns +# networks: files + +# protocols: files +# services: files +# ethers: files +# rpc: files +# # End /etc/nsswitch.conf +# EOF + +# # Replace this with ours? +# cat > %%{buildroot}%%{_sysconfdir}/ld.so.conf <<- "EOF" +# # Begin /etc/ld.so.conf +# %%{_prefix}/local/lib +# /opt/lib +# include %%{_sysconfdir}/ld.so.conf.d/*.conf +# EOF +# Add the /opt/cross libs to the ldcache +# mkdir -p %%{buildroot}%%{_sysconfdir}/ld.so.conf.d/ +# echo %%{buildroot}%%{_sysconfdir}/ld.so.conf.d/%%{name}.conf +# cat > %%{buildroot}%%{_sysconfdir}/ld.so.conf.d/%%{name}.conf </dev/null && n=$((n+1)) ||: +# grep "^FAIL: stdio-common/test-vfprintf" tests.sum >/dev/null && n=$((n+1)) ||: +# # FAIL always on overlayfs/aufs (in container) +# grep "^FAIL: posix/tst-dir" tests.sum >/dev/null && n=$((n+1)) ||: + +# #https://sourceware.org/glibc/wiki/Testing/Testsuite +# grep "^FAIL: nptl/tst-eintr1" tests.sum >/dev/null && n=$((n+1)) ||: +# #This happens because the kernel fails to reap exiting threads fast enough, +# #eventually resulting an EAGAIN when pthread_create is called within the test. + +# # check for exact 'n' failures +# [ `grep ^FAIL tests.sum | wc -l` -ne $n ] && exit 1 ||: + +# Turning off so we don't get ldconfig errors for crossarch packages +# %%post -p /sbin/ldconfig +# %%postun -p /sbin/ldconfig + +%files -f %{name}.lang +%defattr(-,root,root) +%license LICENSES +#%%{_libdir}/locale/* +#%%dir %%{_sysconfdir}/ld.so.conf.d +#%%config(noreplace) %%{_cross_sysroot}%%{_sysconfdir}/nsswitch.conf +# Should we be using sysroot ld, or local ld? +#%%config(noreplace) %%{_sysconfdir}/ld.so.conf +%config(noreplace) %{_cross_sysroot}%{_sysconfdir}/rpc +#%%config(missingok,noreplace) %%{_sysconfdir}/ld.so.cache + +# Converted to libdir from lib64dir +%{_cross_sysroot}/%{_libdir}/* +#%%ifarch aarch64 +# All our libs are in here... do we omit it? +#%%exclude /lib +#%%endif + +#%%exclude /lib64/libpcprofile.so + +#%%{_lib64dir}/*.so +%{_cross_sysroot}/sbin/ldconfig +%{_cross_sysroot}%{_sbindir}/zic +%{_cross_sysroot}%{_sbindir}/iconvconfig +%{_cross_sysroot}%{_bindir}/* +%{_cross_sysroot}%{_libexecdir}/* +#%%{_cross_sysroot}%%{_datadir}/i18n/charmaps/UTF-8.gz +#%%{_cross_sysroot}%%{_datadir}/i18n/charmaps/ISO-8859-1.gz +#%%{_cross_sysroot}%%{_datadir}/i18n/locales/en_US + +%{_cross_sysroot}%{_datadir}/locale/locale.alias +# This doesn't exist? +%exclude %{_cross_sysroot}%{_localstatedir}/lib/nss_db/Makefile +# Only have one package, don't split these off +#%%exclude %%{_cross_sysroot}%%{_bindir}/mtrace +#%%exclude %%{_cross_sysroot}%%{_bindir}/pcprofiledump +#%%exclude %%{_cross_sysroot}%%{_bindir}/xtrace + +# %%files iconv +# %%defattr(-,root,root) +# Converted to libdir from lib64dir, overlap with previous entry +#%%{_cross_sysroot}%%{_libdir}/gconv/* + +#%%files tools +#%%defattr(-,root,root) +#%%{_cross_sysroot}%%{_bindir}/mtrace +#%%{_cross_sysroot}%%{_bindir}/pcprofiledump +#%%{_cross_sysroot}%%{_bindir}/xtrace +%{_cross_sysroot}%{_sbindir}/sln +# Converted to libdir from lib64dir +# Already listed +#%%{_cross_sysroot}%%{_libdir}/audit/* +#%%{_cross_sysroot}%%{_libdir}/libpcprofile.so + +#%%files nscd +#%%defattr(-,root,root) +#%%config(noreplace) %%{_cross_sysroot}%%{_sysconfdir}/nscd.conf +%{_cross_sysroot}%{_sbindir}/nscd +#Not creating the cache +#%%dir %%{_cross_sysroot}%%{_localstatedir}/cache/nscd + +#%%files i18n +#%%defattr(-,root,root) +%{_cross_sysroot}%{_datadir}/i18n/charmaps/*.gz +%{_cross_sysroot}%{_datadir}/i18n/locales/* +# Single package, don't split +#%%exclude %%{_datadir}/i18n/charmaps/UTF-8.gz +#%%exclude %%{_datadir}/i18n/charmaps/ISO-8859-1.gz +#%%exclude %%{_datadir}/i18n/locales/en_US + +#%%files devel +#%%defattr(-,root,root) +# TODO: Excluding for now to remove dependency on PERL +# /usr/bin/mtrace +# These already listed +#%%{_cross_sysroot}%%{_libdir}/*.a +#%%{_cross_sysroot}%%{_libdir}/*.o +%{_cross_sysroot}%{_includedir}/* + +#%%files -f %%{name}.lang lang +#%%defattr(-,root,root) + +%changelog +* Thu Dec 15 2022 Dallas Delaney - 2.35-2 +- Update to 2.35-2 + +* Thu Dec 10 2020 Joe Schmitt - 2.28-14 +- Provide isa version of glibc-static. + +* Mon Sep 28 2020 Ruying Chen - 2.28-13 +- Move some tools from glibc-tools and glibc-iconv to glibc and provide glibc-common +- Provide glibc-static and glibc-headers under glibc-devel + +* Wed Jul 29 2020 Thomas Crain - 2.28-12 +- Ignore CVE-2018-20796, as it is not a security issue + +* Wed Jul 29 2020 Emre Girgin - 2.28-11 +- Disable the debuginfo package for glibc, and use unstripped binaries instead. + +* Fri Jun 26 2020 Ruying Chen - 2.28-10 +- Added provides for binary capability. + +* Thu Jun 11 2020 Henry Beberman - 2.28-9 +- Disable -Wp,-D_FORTIFY_SOURCE=2 to build with hardened cflags. + +* Tue May 19 2020 Emre Girgin - 2.28-8 +- Ignore CVE-2019-6488, CVE-2020-1751, CVE-2020-6096 as they don't apply to aarch64 or x86_64. + +* Sat May 09 2020 Nick Samson - 2.28-7 +- Added %%license line automatically + +* Fri Mar 20 2020 Andrew Phelps - 2.28-6 +- Configure with --disable-werror. + +* Mon Dec 02 2019 Saravanan Somasundaram - 2.28-5 +- Initial CBL-Mariner import from Photon (license: Apache2). + +* Fri Jul 12 2019 Ankit Jain - 2.28-4 +- Replaced spaces with tab in nsswitch.conf file + +* Fri Mar 08 2019 Alexey Makhalov - 2.28-3 +- Fix CVE-2019-9169 + +* Tue Jan 22 2019 Anish Swaminathan - 2.28-2 +- Fix CVE-2018-19591 + +* Tue Aug 28 2018 Alexey Makhalov - 2.28-1 +- Version update. Disable obsolete rpc (use libtirpc) and nsl. + +* Tue Jan 23 2018 Xiaolin Li - 2.26-10 +- Fix CVE-2018-1000001 and CVE-2018-6485 + +* Mon Jan 08 2018 Xiaolin Li - 2.26-9 +- Fix CVE-2017-16997 + +* Thu Dec 21 2017 Xiaolin Li - 2.26-8 +- Fix CVE-2017-17426 + +* Tue Nov 14 2017 Alexey Makhalov - 2.26-7 +- Aarch64 support + +* Wed Oct 25 2017 Xiaolin Li - 2.26-6 +- Fix CVE-2017-15670 and CVE-2017-15804 + +* Tue Oct 10 2017 Alexey Makhalov - 2.26-5 +- Compile out tcache. + +* Fri Sep 15 2017 Bo Gan - 2.26-4 +- exclude tst-eintr1 per official wiki recommendation. + +* Tue Sep 12 2017 Alexey Makhalov - 2.26-3 +- Fix makecheck for run in docker. + +* Tue Aug 29 2017 Alexey Makhalov - 2.26-2 +- Fix tunables setter. +- Add malloc arena fix. +- Fix makecheck. + +* Tue Aug 15 2017 Alexey Makhalov - 2.26-1 +- Version update + +* Tue Aug 08 2017 Anish Swaminathan - 2.25-4 +- Apply fix for CVE-2017-1000366 + +* Thu May 4 2017 Bo Gan - 2.25-3 +- Remove bash dependency in post/postun script + +* Fri Apr 21 2017 Alexey Makhalov - 2.25-2 +- Added -iconv -tools and -nscd subpackages + +* Wed Mar 22 2017 Alexey Makhalov - 2.25-1 +- Version update + +* Wed Dec 14 2016 Alexey Makhalov - 2.24-1 +- Version update + +* Wed Nov 23 2016 Alexey Makhalov - 2.22-13 +- Install en_US.UTF-8 locale by default + +* Wed Nov 16 2016 Alexey Makhalov - 2.22-12 +- Added i18n subpackage + +* Tue Oct 25 2016 Alexey Makhalov - 2.22-11 +- Workaround for build failure with "out of memory" message + +* Wed Sep 28 2016 Alexey Makhalov - 2.22-10 +- Added pthread_create-fix-use-after-free.patch + +* Tue Jun 14 2016 Divya Thaluru - 2.22-9 +- Enabling rpm debug package and stripping the libraries + +* Tue May 24 2016 Priyesh Padmavilasom - 2.22-8 +- GA - Bump release of all rpms + +* Mon May 23 2016 Divya Thaluru - 2.22-7 +- Added patch for CVE-2014-9761 + +* Mon Mar 21 2016 Alexey Makhalov - 2.22-6 +- Security hardening: nonow + +* Fri Mar 18 2016 Anish Swaminathan - 2.22-5 +- Change conf file qualifiers + +* Fri Mar 11 2016 Priyesh Padmavilasom - 2.22-4 +- Added patch for res_qeury assertion with bad dns config +- Details: https://sourceware.org/bugzilla/show_bug.cgi?id=19791 + +* Tue Feb 16 2016 Anish Swaminathan - 2.22-3 +- Added patch for CVE-2015-7547 + +* Mon Feb 08 2016 Anish Swaminathan - 2.22-2 +- Added patch for bindresvport blacklist + +* Tue Jan 12 2016 Xiaolin Li - 2.22-1 +- Updated to version 2.22 + +* Tue Dec 1 2015 Divya Thaluru - 2.19-8 +- Disabling rpm debug package and stripping the libraries + +* Wed Nov 18 2015 Divya Thaluru - 2.19-7 +- Adding patch to close nss files database + +* Tue Nov 10 2015 Xiaolin Li - 2.19-6 +- Handled locale files with macro find_lang + +* Wed Aug 05 2015 Kumar Kaushik - 2.19-5 +- Adding postun section for ldconfig. + +* Tue Jul 28 2015 Alexey Makhalov - 2.19-4 +- Support glibc building against current rpm version. + +* Thu Jul 23 2015 Divya Thaluru - 2.19-3 +- Packing locale-gen scripts + +* Mon May 18 2015 Touseef Liaqat - 2.19-2 +- Update according to UsrMove. + +* Wed Nov 5 2014 Divya Thaluru - 2.19-1 +- Initial build. First version diff --git a/SPECS/cross-glibc-bootstrap/glibc-2.34_pthread_cond_wait.patch b/SPECS/cross-glibc-bootstrap/glibc-2.34_pthread_cond_wait.patch new file mode 100644 index 00000000000..bf04421f817 --- /dev/null +++ b/SPECS/cross-glibc-bootstrap/glibc-2.34_pthread_cond_wait.patch @@ -0,0 +1,19 @@ +diff -ruN a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c +--- a/nptl/pthread_cond_wait.c 2021-11-05 15:04:17.337600296 -0700 ++++ b/nptl/pthread_cond_wait.c 2021-11-05 15:05:23.813388264 -0700 +@@ -589,6 +589,15 @@ + the signal from, which cause it to block using the + futex). */ + futex_wake (cond->__data.__g_signals + g, 1, private); ++ ++ /* We might be wrong about stealing, we got the signal ++ from the an old g1, but ended up returning it to ++ a different g1. We can't tell whether it is the case. ++ If it is, we now caused another issue: ++ now g_refs[g1] is one less than g_size[g1]. ++ The mitigation step is to broadcast g1 and g2, let every ++ waiter wake up spuriosly. */ ++ __pthread_cond_broadcast(cond); + break; + } + /* TODO Back off. */ diff --git a/SPECS/cross-glibc-bootstrap/glibc-2.35-fhs-1.patch b/SPECS/cross-glibc-bootstrap/glibc-2.35-fhs-1.patch new file mode 100644 index 00000000000..4ac8d106bbd --- /dev/null +++ b/SPECS/cross-glibc-bootstrap/glibc-2.35-fhs-1.patch @@ -0,0 +1,72 @@ +Submitted By: Armin K. +Date: 2013-02-11 +Initial Package Version: 2.17 +Upstream Status: Not Applicable +Origin: Self +Description: This patch removes references to /var/db directory which is not part + of FHS and replaces them with more suitable directories in /var + hierarchy - /var/cache/nscd for nscd and /var/lib/nss_db for nss_db. + +--- a/Makeconfig 2012-12-25 04:02:13.000000000 +0100 ++++ b/Makeconfig 2013-02-11 01:32:32.500667439 +0100 +@@ -250,7 +250,7 @@ + + # Directory for the database files and Makefile for nss_db. + ifndef vardbdir +-vardbdir = $(localstatedir)/db ++vardbdir = $(localstatedir)/lib/nss_db + endif + inst_vardbdir = $(install_root)$(vardbdir) + +--- a/nscd/nscd.h 2012-12-25 04:02:13.000000000 +0100 ++++ b/nscd/nscd.h 2013-02-11 01:32:32.500667439 +0100 +@@ -112,11 +112,11 @@ + + + /* Paths of the file for the persistent storage. */ +-#define _PATH_NSCD_PASSWD_DB "/var/db/nscd/passwd" +-#define _PATH_NSCD_GROUP_DB "/var/db/nscd/group" +-#define _PATH_NSCD_HOSTS_DB "/var/db/nscd/hosts" +-#define _PATH_NSCD_SERVICES_DB "/var/db/nscd/services" +-#define _PATH_NSCD_NETGROUP_DB "/var/db/nscd/netgroup" ++#define _PATH_NSCD_PASSWD_DB "/var/cache/nscd/passwd" ++#define _PATH_NSCD_GROUP_DB "/var/cache/nscd/group" ++#define _PATH_NSCD_HOSTS_DB "/var/cache/nscd/hosts" ++#define _PATH_NSCD_SERVICES_DB "/var/cache/nscd/services" ++#define _PATH_NSCD_NETGROUP_DB "/var/cache/nscd/netgroup" + + /* Path used when not using persistent storage. */ + #define _PATH_NSCD_XYZ_DB_TMP "/var/run/nscd/dbXXXXXX" +--- a/nss/db-Makefile 2012-12-25 04:02:13.000000000 +0100 ++++ b/nss/db-Makefile 2013-02-11 01:32:32.500667439 +0100 +@@ -22,7 +22,7 @@ + /etc/rpc /etc/services /etc/shadow /etc/gshadow \ + /etc/netgroup) + +-VAR_DB = /var/db ++VAR_DB = /var/lib/nss_db + + AWK = awk + MAKEDB = makedb --quiet +--- a/sysdeps/generic/paths.h 2012-12-25 04:02:13.000000000 +0100 ++++ b/sysdeps/generic/paths.h 2013-02-11 01:32:32.500667439 +0100 +@@ -68,7 +68,7 @@ + /* Provide trailing slash, since mostly used for building pathnames. */ + #define _PATH_DEV "/dev/" + #define _PATH_TMP "/tmp/" +-#define _PATH_VARDB "/var/db/" ++#define _PATH_VARDB "/var/lib/nss_db/" + #define _PATH_VARRUN "/var/run/" + #define _PATH_VARTMP "/var/tmp/" + +--- a/sysdeps/unix/sysv/linux/paths.h 2012-12-25 04:02:13.000000000 +0100 ++++ b/sysdeps/unix/sysv/linux/paths.h 2013-02-11 01:32:32.504000831 +0100 +@@ -68,7 +68,7 @@ + /* Provide trailing slash, since mostly used for building pathnames. */ + #define _PATH_DEV "/dev/" + #define _PATH_TMP "/tmp/" +-#define _PATH_VARDB "/var/db/" ++#define _PATH_VARDB "/var/lib/nss_db/" + #define _PATH_VARRUN "/var/run/" + #define _PATH_VARTMP "/var/tmp/" + diff --git a/SPECS/cross-glibc-bootstrap/locale-gen.conf b/SPECS/cross-glibc-bootstrap/locale-gen.conf new file mode 100644 index 00000000000..04ed0bbca8f --- /dev/null +++ b/SPECS/cross-glibc-bootstrap/locale-gen.conf @@ -0,0 +1,26 @@ + +# Configuration file for locale-gen +# +# lists of locales that are to be generated by the locale-gen command. +# +# Each line is of the form: +# +# +# +# where is one of the locales given in /usr/share/i18n/locales +# and is one of the character sets listed in /usr/share/i18n/charmaps +# +# Examples: +# en_US ISO-8859-1 +# en_US.UTF-8 UTF-8 +# de_DE ISO-8859-1 +# de_DE@euro ISO-8859-15 +# +# The locale-gen command will generate all the locales, +# placing them in /usr/lib/locale. +# +# A list of supported locales is included in this file. +# Uncomment the ones you need. +# +en_US ISO-8859-1 +en_US.UTF-8 UTF-8 diff --git a/SPECS/cross-glibc-bootstrap/locale-gen.sh b/SPECS/cross-glibc-bootstrap/locale-gen.sh new file mode 100644 index 00000000000..a134aba6b72 --- /dev/null +++ b/SPECS/cross-glibc-bootstrap/locale-gen.sh @@ -0,0 +1,34 @@ +#!/bin/sh +set -e +LOCALEGEN=/etc/locale-gen.conf +LOCALES=/usr/share/i18n/locales +if [ -n "$POSIXLY_CORRECT" ]; then + unset POSIXLY_CORRECT +fi +[ -f $LOCALEGEN -a -s $LOCALEGEN ] || exit 0; +# Remove all old locale dir and locale-archive before generating new +# locale data. +rm -rf /usr/lib/locale/* || true +umask 022 +is_entry_ok() { + if [ -n "$locale" -a -n "$charset" ] ; then + true + else + echo "error: Bad entry '$locale $charset'" + false + fi +} +echo "Generating locales..." +while read locale charset; do \ + case $locale in \#*) continue;; "") continue;; esac; \ + is_entry_ok || continue + echo -n " `echo $locale | sed 's/\([^.\@]*\).*/\1/'`"; \ + echo -n ".$charset"; \ + echo -n `echo $locale | sed 's/\([^\@]*\)\(\@.*\)*/\2/'`; \ + echo -n '...'; \ + if [ -f $LOCALES/$locale ]; then input=$locale; else \ + input=`echo $locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'`; fi; \ + localedef -i $input -c -f $charset -A /usr/share/locale/locale.alias $locale; \ + echo ' done'; \ +done < $LOCALEGEN +echo "Generation complete." \ No newline at end of file diff --git a/SPECS/cross-kernel-headers/cross-kernel-headers.signatures.json b/SPECS/cross-kernel-headers/cross-kernel-headers.signatures.json new file mode 100644 index 00000000000..53f0ab5d9c7 --- /dev/null +++ b/SPECS/cross-kernel-headers/cross-kernel-headers.signatures.json @@ -0,0 +1,5 @@ +{ + "Signatures": { + "kernel-5.15.57.1.tar.gz": "010bbb79b84d9df58a1b8d3198d46466d9d042e3fb2fe24b7b9ef10c109449a8" + } +} \ No newline at end of file diff --git a/SPECS/cross-kernel-headers/cross-kernel-headers.spec b/SPECS/cross-kernel-headers/cross-kernel-headers.spec new file mode 100644 index 00000000000..0c430ae9569 --- /dev/null +++ b/SPECS/cross-kernel-headers/cross-kernel-headers.spec @@ -0,0 +1,192 @@ +# Globals which should be in a macro file. +# These should be set programatically in the future. +%global _host_arch x86_64 +%global _target_arch aarch64 +%global _tuple %{_target_arch}-%{_vendor}-linux-gnu +%global _cross_name %{_target_arch}-%{_vendor}-linux-gnu + +# Folders which should be in our macro file +%global _opt /opt/ +%global _crossdir /opt/cross/ + +# Generally we include '/usr' in most paths. +# Can we also use '/usr' for our paths? This will bring us in line with the +# %%configure macro which sets these. +%global _bindir /bin +%global _sbindir /sbin +%global _libdir /lib +%global _lib64dir /lib64 +%global _libexecdir /libexec +%global _datadir /share +%global _docdir /share/doc +%global _includedir /include +%global _infodir /share/info +%global _mandir /share/man +%global _oldincludedir /include + + +# Why is this wrong? We get "x86_64-pc-linux-gnu" when eval'd, but our +# tools select "aarch64-linux-gnu" +%global _host_vendor %{nil} + +# If we want our cross compile aware packges to also support native, we +# need logic to switch modes something like this: +%if "%{_target_arch}" != "%{_host_arch}" +%global _cross_prefix %{_crossdir}%{_tuple}/ +%global _cross_sysroot %{_crossdir}%{_tuple}/sysroot/ +%global _cross_includedir /usr/%{_host}/%{_tuple}/include/ +%global _cross_infodir %{_crossdir}%{_tuple}/share/info +%global _cross_bindir %{_tuple}/bin +%global _cross_libdir %{_tuple}/lib +%global _tuple_name %{_tuple}- +%else +%global _cross_prefix %{nil} +%global _cross_sysroot %{nil} +%global _cross_includedir %{_includedir} +%global _cross_infodir %{_infodir} +%global _cross_bindir %{_bindir} +%global _cross_libdir %{_libdir} +%global _tuple_name %{nil} +%endif + +Summary: Linux API header files +Name: %{_cross_name}-kernel-headers +Version: 5.15.57.1 +Release: 3%{?dist} +License: GPLv2 +URL: https://github.com/microsoft/CBL-Mariner-Linux-Kernel +Group: System Environment/Kernel +Vendor: Microsoft Corporation +Distribution: Mariner +#Source0: https://github.com/microsoft/CBL-Mariner-Linux-Kernel/archive/rolling-lts/mariner-2/%%{version}.tar.gz +Source0: kernel-%{version}.tar.gz +BuildArch: noarch +Provides: %{_cross_name}-glibc-kernheaders = %{version}-%{release} +%if "%{_target_arch}" == "x86_64" +%define arch x86_64 +%endif + +%if "%{_target_arch}" == "aarch64" +%define arch arm64 +%endif + +%description +The Linux API Headers expose the kernel's API for use by Glibc. + +%prep +%setup -q -n CBL-Mariner-Linux-Kernel-rolling-lts-mariner-2-%{version} + +%build +make mrproper + +%install +cd %{_builddir}/CBL-Mariner-Linux-Kernel-rolling-lts-mariner-2-%{version} +make ARCH=%{arch} headers +find usr/include -name '.*' -delete +rm usr/include/Makefile +mkdir -p /%{buildroot}%{_cross_sysroot}%{_includedir} +cp -rv usr/include/* /%{buildroot}%{_cross_sysroot}%{_includedir} + +%files +%defattr(-,root,root) +%license COPYING +%{_cross_sysroot}%{_includedir}/* + +%changelog +* Thu Dec 15 2022 Dallas Delaney - 5.15.57.1-3 +- Update to 5.15.57.1 +* Mon Jun 20 2022 Chris Co - 5.15.48.1-1 +- Update to 5.15.48.1 +* Thu Feb 11 2021 Daniel McIlvaney - 5.4.51-13 +- Fork normal kernel-headers package into cross compile aware version +* Mon Jan 11 2021 Thomas Crain - 5.4.51-12 +- Update Release tag to match that of the kernel package +* Mon Sep 28 2020 Ruying Chen 5.4.51-3 +- Add explicit provide for glibc-kernheaders +* Tue Sep 01 2020 Chris Co 5.4.51-2 +- Update source hash +* Wed Aug 19 2020 Chris Co 5.4.51-1 +- Update source to 5.4.51 +* Fri Jun 12 2020 Chris Co 5.4.42-1 +- Update source to 5.4.42 +* Thu Apr 30 2020 Emre Girgin 5.4.23-2 +- Renaming linux-api-headers to kernel-headers +* Tue Dec 10 2019 Chris Co 5.4.23-1 +- Update to Microsoft Linux Kernel 5.4.23. +- Use make headers since with 5.4, headers_install now requires rsync. +* Tue Sep 03 2019 Mateusz Malisz 4.19.52-2 +- Initial CBL-Mariner import from Photon (license: Apache2). +* Mon Jun 17 2019 Srivatsa S. Bhat (VMware) 4.19.52-1 +- Update to version 4.19.52 +* Tue May 07 2019 Ajay Kaher 4.19.40-1 +- Update to version 4.19.40 +* Wed Mar 27 2019 Srivatsa S. Bhat (VMware) 4.19.32-1 +- Update to version 4.19.32 +* Thu Mar 14 2019 Srivatsa S. Bhat (VMware) 4.19.29-1 +- Update to version 4.19.29 +* Tue Mar 05 2019 Ajay Kaher 4.19.26-1 +- Update to version 4.19.26 +* Tue Jan 15 2019 Srivatsa S. Bhat (VMware) 4.19.15-1 +- Update to version 4.19.15 +* Mon Dec 10 2018 Srivatsa S. Bhat (VMware) 4.19.6-1 +- Update to version 4.19.6 +* Mon Nov 05 2018 Srivatsa S. Bhat (VMware) 4.19.1-1 +- Update to version 4.19.1 +* Thu Sep 20 2018 Srivatsa S. Bhat 4.18.9-1 +- Update to version 4.18.9 +* Wed Sep 19 2018 Srivatsa S. Bhat 4.14.67-1 +- Update to version 4.14.67 +* Mon Jul 09 2018 Him Kalyan Bordoloi 4.14.54-1 +- Update to version 4.14.54 +* Fri Dec 22 2017 Alexey Makhalov 4.14.8-1 +- Version update +* Mon Dec 04 2017 Srivatsa S. Bhat 4.9.66-1 +- Version update +* Tue Nov 21 2017 Srivatsa S. Bhat 4.9.64-1 +- Version update +* Mon Nov 06 2017 Srivatsa S. Bhat 4.9.60-1 +- Version update +* Thu Oct 05 2017 Srivatsa S. Bhat 4.9.53-1 +- Version update +* Mon Oct 02 2017 Srivatsa S. Bhat 4.9.52-1 +- Version update +* Mon Sep 04 2017 Alexey Makhalov 4.9.47-1 +- Version update +* Mon Aug 14 2017 Alexey Makhalov 4.9.43-1 +- Version update +* Wed Jun 28 2017 Alexey Makhalov 4.9.34-1 +- Version update +* Fri May 26 2017 Alexey Makhalov 4.9.30-1 +- Version update +* Tue May 16 2017 Alexey Makhalov 4.9.28-1 +- Version update +* Wed May 10 2017 Alexey Makhalov 4.9.27-1 +- Update to linux-4.9.27 +* Sun May 7 2017 Alexey Makhalov 4.9.26-1 +- Update to linux-4.9.26 +* Tue Apr 25 2017 Alexey Makhalov 4.9.24-1 +- Update to linux-4.9.24 +* Tue Feb 28 2017 Alexey Makhalov 4.9.13-1 +- Update to linux-4.9.13 +* Thu Feb 09 2017 Alexey Makhalov 4.9.9-1 +- Update to linux-4.9.9 +* Tue Jan 10 2017 Alexey Makhalov 4.9.2-1 +- Update to linux-4.9.2 +* Mon Dec 12 2016 Alexey Makhalov 4.9.0-1 +- Update to linux-4.9.0 +* Mon Nov 28 2016 Alexey Makhalov 4.4.35-1 +- Update to linux-4.4.35 +* Thu Nov 10 2016 Alexey Makhalov 4.4.31-1 +- Update to linux-4.4.31 +* Wed Sep 7 2016 Alexey Makhalov 4.4.20-1 +- Update kernel version to 4.4.20 +* Tue May 24 2016 Priyesh Padmavilasom 4.4.8-2 +- GA - Bump release of all rpms +* Thu Apr 28 2016 Alexey Makhalov 4.4.8-1 +- Update to linux-4.4.8 +* Wed Dec 16 2015 Harish Udaiya Kumar 4.2.0-1 +- Upgrading kernel version to 4.2.0. +* Wed Aug 12 2015 Sharath George 4.0.9-1 +- Upgrading kernel version. +* Wed Nov 5 2014 Divya Thaluru 3.13.3-1 +- Initial build. First version