Commit Graph

797 Commits

Author SHA1 Message Date
Sundeep KOKKONDA
c6cd61f1a2 gcc: AArch64 - Fix strict-align cpymem/setmem
The cpymemdi/setmemdi implementation doesn't fully support strict alignment.
Block the expansion if the alignment is less than 16 with STRICT_ALIGNMENT.
Clean up the condition when to use MOPS. (PR103100)

The original patch for GCC 12 removed MOPS & SIMD conditionals for setmem and
cpymem expansions in aarch64.md file. However, this version for GCC 11 does not
backport the SIMD & MOPS-related changes and retains the conditions in aarch64.md
file to preserve correctness and compatibility with the GCC 11 backend.

All changes and outputs have been verified by the author.

Upstream-Status: Backport [https://gcc.gnu.org/cgit/gcc/commit/?id=b9d16d8361a9e3a82a2f21e759e760d235d43322]

(From OE-Core rev: a99a65632116955dc69809a14bf536b22582de72)

Signed-off-by: Sundeep KOKKONDA <sundeep.kokkonda@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2025-05-28 08:46:32 -07:00
Ross Burton
966aead7e8 classes/qemu: use tune to select QEMU_EXTRAOPTIONS, not package architecture
Using the package architecture to select the right qemu options to pass
to qemu-user is incorrect, and fails for recipes that set PACKAGE_ARCH
to MACHINE_ARCH (as the qemuppc workarounds suggest) because there are
not typically any options set for the machine name.

Solve this by using TUNE_PKGARCH instead: for the majority of recipes
this is the same value, but for machine-specific recipes it remains the
same instead of changing to the machine name.

This means we can remove the qemuppc workarounds, as they're obsolete.

Also update the gcc-testsuite recipe which uses the same pattern to use
TUNE_PKGARCH, and generalise the else codepath to avoid needing to
update the list of architectures.

[ YOCTO #15647 ]

(From OE-Core rev: 077aab43f2c928eb8da71934405c62327010f552)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2025-01-24 07:49:28 -08:00
Ruiqiang Hao
959405cc37 gcc: restore a patch for Neoverse N2 core
Commit 7806e21e7d47 ("gcc: upgrade to v11.5") removed one patch named
0001-aarch64-Update-Neoverse-N2-core-defini.patch by mistake, this will
cause the Neoverse N2 core to be identified as the armv8.5 architecture,
restore this patch to avoid related compilation issues.

(From OE-Core rev: 4c75edda8ec28fb8dee19ca90a1ea7f33ba80999)

Signed-off-by: Ruiqiang Hao <Ruiqiang.Hao@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-11-11 06:19:18 -08:00
Peter Marko
87ebb58a64 gcc: ignore CVE-2023-4039
Last version bump removed patch for this CVE because it was integrated
in new release. This has caused the CVE to reappear in reports because
2023-09-12 is "higher" than 11.5...

(From OE-Core rev: d74fd7c4e9353fc00f0b79f05de101efb0148a6f)

Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-10-24 06:31:58 -07:00
Deepthi Hemraj
614435f311 gcc: upgrade to v11.5
gcc stable version upgraded from v11.4 to v11.5

Dropped CVE-2023-4039.patch and 0001-aarch64-Update-Neoverse-N2-core-defini.patch
because its been taken to gcc-11.5 with below commits 75c37e0314 and 50d9db203bc

For changes in v11.5 see: https://gcc.gnu.org/gcc-11/changes.html

Below is the bug fix list for v11.5:
https://gcc.gnu.org/bugzilla/buglist.cgi?bug_status=RESOLVED&list_id=444046&resolution=FIXED&target_milestone=11.5

There are a total 164 bugs are fixed in this release, below is the list of bugs fixed excluding the regression fixes.
ID      Product  Comp       Assignee▲       Summary
112672	gcc	target	   ubizjak	[14 Regression] wrong code with __builtin_parityl() at -O and above on x86_64
111736	gcc	sanitize   unassigned	Address sanitizer is not compatible with named address spaces
80899	gcc	ipa	   hubicka	[11/12/13/14 Regression] Devirtualization causes incorrect code generation with placement new in some cases
105301	gcc	c++	   iains	[11 Regression] ICE: tree check: expected tree that contains 'decl minimal' structure, have 'overload' in coro_promise_type_found_p, at cp/coroutines.cc:516
110027	gcc	middle-e   jakub	[11 regression] Stack objects with extended alignments (vectors etc) misaligned on detect_stack_use_after_return
110079	gcc	rtl-opti   jakub	[11 Regression] ICE with -freorder-blocks-and-partition and inline-asm goto
110731	gcc	tree-opt   jakub	[11/12 Regression] Wrong-code because of wide-int division since r5-424
111015	gcc	tree-opt   jakub	[11/12/13/14 Regression] __int128 bitfields optimized incorrectly to the 64 bit operations
112727	gcc	sanitize   jakub	[11/12/13 Regression] UBSAN creates GIMPLE path with uninitialized variable
113674	gcc	c++	   jakub	[11 Regression] [[____attr____]] causes internal compiler error: in decl_attributes, at attribs.cc:776
114310	gcc	target	   jakub	[11 Regression] [aarch64] __sync_val_compare_and_swap fails on __int128_t with newval = 0
114493	gcc	c	   jakub	[11 Regression] internal compiler error: in fld_incomplete_type_of with may_alias
114566	gcc	tree-opt   jakub	[11 Regression] Misaligned vmovaps when compiling with stack-protector-strong for znver4
114634	gcc	c++	   jakub	[11 Regression] Crash Issue Encountered in GCC Compilation of Template Code with Aligned Attribute since r9-1745
114691	gcc	c++	   jakub	[11 Regression] Bogus ignoring loop annotation warning
114825	gcc	fortran	   Jakub	[11 Regression] Compiler error using gfortran and OpenMP since r5-1190
114876	gcc	tree-opt   jakub	[11 Regression] -fprintf-return-value mishandles %lc with a '\0' argument.
114956	gcc	sanitize   jakub	[11 Regression] Segmentation fault with -fsanitize=address -fsanitize=null -O2 when attribute no_sanitize_address is enabled since r9-5742
106890	gcc	c++	   jason	[11 Regression] virtual inheritance triggers compiler error when instatiating derived class with in-class initialization since r8-2709-g12659e10c7820071
111529	gcc	c++	   jason	[11/12/13 Regression] ICE on bool conversion in an unrolled loop condition inside template lambda nested in another template scope
113598	gcc	c++	   jason	[11/12/13 Regression] GCC internal compiler error since r0-124275
114561	gcc	c++	   jason	[11/12 Regression] Comma operator with forwarding reference to pointer raises invalid lvalue required error since r10-7410
114562	gcc	c++	   jason	[11/12 Regression] ICE when trying to bind rvalue reference to lvalue with comma operator and forwarding reference to pointer since r10-7410
115565	gcc	rtl-opti   macro	[11/12/13/14/15 Regression] CSE: Comparison incorrectly evaluated as constant causing optimization to produce wrong code
109876	gcc	c++	  mpolacek	[11/12 Regression] initializer_list not usable in constant expressions in a template
110106	gcc	c++	  mpolacek	[11/12 Regression] ICE on noexcept(noexcept(...)) with optional
89224	gcc	c++	   pinskia	[11/12/13/14/15 Regression] subscript of const vector has the wrong type
110386	gcc	tree-opt   pinskia	[11/12 Regression] ICE with ABSU in backprop
111331	gcc	tree-opt   pinskia	[11/12 Regression] Wrong code at -O1 on x86_64-linux-gnu since
108120	gcc	target	  rearnsha	[11/12 Regression] ICE: in extract_insn, at recog.cc:2791 (on ARM with -mfpu=neon -freciprocal-math -O3)
95048	gcc	libstdc+    redi	[11 Regression] wstring-constructor of std::filesystem::path throws for non-ASCII characters
104606	gcc	libstdc+    redi	[11 Regression] comparison operator resolution with std::optional and -std=c++20
90348	gcc	middle-e   rguenth	[11 Regression] Partition of char arrays is incorrect in some cases
96881	gcc	tree-opt   rguenth	[11 Regression] Clobbers on NULL vs. DCE since r8-1519
97990	gcc	c++	   rguenth	[11 Regression] ICE: ‘verify_type’ failed with vector types and non-PODs since r6-5222-gba6a6a1d44c17f25
103006	gcc	middle-e   rguenth	[12/13/14/15 Regression] wrong code at -O1 or -O2 on x86_64-linux-gnu by r7-7101
110176	gcc	tree-opt   rguenth	[11 Regression] wrong code at -Os and above on x86_64-linux-gnu since r11-2446
110295	gcc	c++	   rguenth	[11 Regression] ICE in dwarf2out_finish with local class with inherited operator delete in a templated function and -g
110298	gcc	tree-opt   rguenth	[11 Regression] ICE at -Os on x86_64-linux-gnu since r10-840
111039	gcc	tree-opt   rguenth	[11 Regression] Unable to coalesce ssa_names
111080	gcc	debug	   rguenth	[11 Regression] restrict qualifier causes extra debug info to happen
111472	gcc	tree-opt   rguenth	[11 Regression] Wrong code at -Os on x86_64-linux-gnu since r11-4563-gd0d8b5d836
111614	gcc	tree-opt   rguenth	[11 Regression] ICE at -O2: verify_gimple failed since r14-2282-gf703d2fd3f0
111764	gcc	tree-opt   rguenth	[11 Regression] Wrong code at -O3 on x86_64-linux-gnu
111818	gcc	middle-e   rguenth	[11 Regression] ICE with __builtin_memcpy with volatile and constants
111917	gcc	tree-opt   rguenth	[11 Regression] ICE in as_a, at is-a.h:255 since GCC-7
112495	gcc	tree-opt   rguenth	[11 Regression] ICE: verify_gimple failed (after vectorizer) with named address space (__seg_gs )
112505	gcc	tree-opt   rguenth	[11 Regression] internal compiler error: in build_vector_from_val, at tree.cc:2104 since r10-4076
112718	gcc	debug	   rguenth	[11 Regression] ICE: in add_dwarf_attr, at dwarf2out.cc:4501 with -g -fdebug-types-section -flto -ffat-lto-objects
112793	gcc	tree-opt   rguenth	[11 regression] ICE when building stellarium (internal compiler error: in vect_schedule_slp_node, at tree-vect-slp.cc:9062)
114027	gcc	tree-opt   rguenth	[11 Regression] miscompile at `-O3 -fno-vect-cost-model -msse4.2`
114734	gcc	target	   rguenth	[11 regression] RISC-V rv64gcv_zvl256b miscompile with -flto -O3 -mrvv-vector-bits=zvl since r8-6047-g65dd1346027bb5
108086	gcc	rtl-opti   rsandifo	[11 Regression] internal compiler error: in set_accesses, at rtl-ssa/internals.inl:449
113281	gcc	tree-opt   rsandifo	[11 Regression] Latent wrong code due to vectorization of shift reduction and missing promotions since r9-1590
113552	gcc	tree-opt   tnfchris	[11/12/13 Regression] vectorizer generates calls to vector math routines with 1 simd lane.
29256	gcc	target	  unassigned	[11/12/13/14 regression] loop performance regression
82446	gcc	tree-opt unassigned	[11/12/13/14 Regression] Missed equalities in dr_group_sort_cmp
93631	gcc	c	 unassigned	[11/12/13/14 Regression] ICE on an invalid strcmp call in gimple_call_arg, at gimple.h:3258
93930	gcc	target	 unassigned	[11/12/13/14 Regression] Unnecessary broadcast instructions for AVX512
94335	gcc	tree-opt unassigned	[11/12/13/14 Regression] False positive -Wstringop-overflow warning with -O2
97140	gcc	target	 unassigned	[11/12/13/14 Regression] ICE in error: unable to generate reloads for since r10-400-gecfdb16c54ad06ac
100623	gcc	target	 unassigned	[11 Regression] wrong code with -Os -fno-dce -fno-defer-pop -fno-forward-propagate -flive-range-shrinkage -fno-rerun-cse-after-loop -mno-push-args since r10-7515-g2c0fa3ecf70d199a
100667	gcc	libstdc+ unassigned	[11/12 Regression] std::tuple<A&&> cannot be constructed from A&&, if A not defined (only forward declared)
103497	gcc	c++	 unassigned	[11/12/13/14 Regression] ICE when decltype(auto)... as parameters
105034	gcc	target	 unassigned	[11/12/13/14 regression]Suboptimal codegen for min/max with -Os
107057	gcc	rtl-opti unassigned	[11/12 Regression] ICE in extract_constrain_insn, at recog.cc:2692
109800	gcc	target	 acoplan	[11 Regression] arm: ICE (segfault) loading double with -mpure-code -mbig-endian
110288	gcc	fortran	  anlauf	[11/12/13/14] Regression: segfault in findloc with allocatable array of allocatable characters
110585	gcc	fortran	  anlauf	ICE in gfc_compare_expr for findloc with complex literal array
110658	gcc	fortran	  anlauf	MINVAL/MAXVAL and deferred-length character arrays
115611	gcc	target	  avieira	mve: vsetq_lane for 64-bits has wrong codegen when setting lane 1
113893	gcc	ada	 ebotcazou	finalization of object allocated by anonymous access type designating local type
111050	gcc	libstdc+  fdumont	[11/12/13/14 Regression] ABI break in _Hash_node_value_base since GCC 11
110624	gcc	target	   iains	Xcode 15 ld warns about -macosx_version_min
114171	gcc	d	 ibuclaw	[13/14 Regression] gdc -O2 -mavx generates misaligned vmovdqa instruction
108789	gcc	middle-e   jakub	__builtin_(add|mul|sub)_overflow methods generate duplicate operations if both operands are const which in turn causes wrong code due to overlapping arguments
110115	gcc	middle-e   jakub	[11 Regression] Wrong code at -O1 on x86_64-linux-gnu
110914	gcc	tree-opt   jakub	[11/12/13/14 Regression] Optimization eliminating necessary assignment before 0-byte memcpy since r10-5451
111422	gcc	middle-e   jakub	Wrong code at -O3 on x86_64-linux-gnu
112816	gcc	target	   jakub	[11/12 Regression] ICE unrecognizable_insn with __builtin_signbit and returning struct with int[4]
113122	gcc	target	   jakub	Assembler messages: Error: operand type mismatch for `movabs' / bad expression / invalid use of register with -fprofile -mcmodel=large -masm=intel
113192	gcc	libgomp	   jakub	[11 Regression] ERROR: couldn't execute "../../../gcc/libgomp/testsuite/flock": no such file or directory
113262	gcc	c	   jakub	[11 Regression] ICE when using [[gnu::copy("")]] attribute
114533	gcc	libquadm   jakub	libquadmath: printf: fix misaligned access on args
114537	gcc	c++	   jakub	bit_cast does not work NSDMI of bitfields
114572	gcc	c++	   jakub	[OpenMP] "internal compiler error: in assign_temp" with assignment operator and lastprivate clause
115172	gcc	sanitize   jakub	Invalid -fsanitize=bool sanitization of variable from named address space
115440	gcc	driver	   jakub	unrecognized command-line option '--c++17'; did you mean '--stdc++17'?
110422	gcc	tree-opt   jamborm	asm goto vs SRA
92145	gcc	c++	   jason	-Wdeprecated-copy false-positive when inheriting base assignment operators
92407	gcc	c++	   jason	Destruction of objects returned from functions skipped by goto
103185	gcc	c++	   jason	[11/12/13 Regression] ind[arr] is rejected when arr is an array prvalue
106310	gcc	c++	   jason	[11 Regression] lookup after this-> seems wrong for dependent lookup since r12-6754-g30f2c22def739211
111357	gcc	c++	   jason	[11/12/13/14 Regression] __integer_pack fails to work with values of dependent type convertible to integers in noexcept context
114130	gcc	target	    kito	[11 Regression] RISC-V: `__atomic_compare_exchange` does not use sign-extended value for RV64
113250	gcc	libstdc+   kmatsui	std::filesystem::equivalent("", "/") should throw
115457	gcc	target	   ktkachov	AArch64 should define __ARM_FEATURE_BF16
115475	gcc	target	   ktkachov	AArch64 should define __ARM_FEATURE_SVE_BF16 when appropriate
88309	gcc	target	   linkw	[11/12/13/14 Regression] ICE: Floating point exception (in is_miss_rate_acceptable), target assigning alignent of 4 bits(!) to vector
104259	gcc	libstdc+   marxin	libstdc++ fails for epiphany-elf
109822	gcc	libstdc+   mkretz	Converting std::experimental::simd masks yields an error
59465	gcc	c++	  mpolacek	[11/12/13 Regression] g++ allows direct-initialization of an array of class type from another array in a mem-initializer
100557	gcc	c++	  mpolacek	[11/12/13/14 Regression] Internal compiler error: Error reporting routines re-entered.
115642	gcc	c	  mpolacek	[11/12/13/14/15 Regression] internal compiler error: tree check: expected class 'type', have 'exceptional' (error_mark) in c_expr_sizeof_expr
95351	gcc	middle-e   pinskia	[11/12 Regression] Comparison with NAN optimizes incorrectly with -ffast-math disabled
111699	gcc	middle-e   pinskia	[11/12/13 Regression] ICE: SIGSEGV: infinite recursion in fold_build3_loc/fold_ternary_loc/generic_simplify_VEC_COND_EXPR
109761	gcc	c++	   ppalka	[11/12 Regression] Nested class destructor's noexcept specification incorrectly considered as too loose compared to the outer class
111485	gcc	c++ 	   ppalka	[11/12 Regression] Constraint mismatch on template template parameter
113175	gcc	testsuit   ppalka	[11/12/13/14 Regression] testsuite/std/ranges/iota/max_size_type.cc 5x times slower
111407	gcc	tree-opt   qinzhao	[11/12/13 Regression] ICE: SSA corruption due to widening_mul opt on conflict across an abnormal edge
99327	gcc	libstdc+    redi	ENOTSUP macro does not exist on djgpp crt
104161	gcc	libstdc+     red	Potential Security Vulnerability: remove_all and symbolic link
105178	gcc	libstdc+    redi	[11 Regression] g++ incorrectly reports invalid use of incomplete type
108178	gcc	libstdc+    redi	Filesystem::copy_file can't copy from /proc on Linux machines
112491	gcc	libstdc+    redi	std::deque<T,Allocator>::size xmethod output is wrong
114147	gcc	libstdc+    redi	[11 Regression] tuple allocator-extended constructor requires non-explicit default constructor
114401	gcc	libstdc+    redi	libstdc++ allocator destructor omitted when reinserting node_handle into tree- and hashtable-based containers
96109	gcc	testsuit    rguenth	[11 Regression] gcc.dg/vect/slp-47.c etc. FAIL
110182	gcc	tree-opt    rguenth	[11 Regression] Vector(2) cast from double to float and back and subtraction seems to produce incorrect results
110200	gcc	middle-e    rguenth	genmatch generating questionable code with convert and !
98237	gcc	ipa	      ro        gcc-dg-lto-modref-3-01.exe etc. FAIL when LTO plugin is not enabled
97696	gcc	sanitize    rsandifo	ICE since ASAN_MARK does not handle poly_int sized varibales
100303	gcc	debug	    rsandifo	[11 Regression] -fcompare-debug failure (length) with -O -fno-dce -ftracer
111340	gcc	target	    ubizjak	gcc.dg/bitint-12.c fails on x86_64-apple-darwin or fails on x86_64-linux-gnu with -fPIE
115297	gcc	rtl-opti    ubizjak	[14/15 regression] alpha: ICE in simplify_subreg, at simplify-rtx.cc:7554 with -O1
115836	gcc	middle-e    ubizjak	ICE when building Firefox with-march=pentium-mmx -mtune=pentium-m
91085	gcc	other	   unassigned	[11 only] fixincludes breaks <bits/statx.h>
103183	gcc	c++	   unassigned	[11/12/13/14 Regression] ind[arr] produces an lvalue when arr is an array xvalue
105417	gcc	libstdc+   unassigned	[11 Regression] powerpc64le-linux abilist changes based on --with-long-double-format=
110309	gcc	target	   unassigned	Wrong code for masked load expansion
111922	gcc	ipa	   unassigned	[11/12/13/14 Regression] ICE in cp with -O2 -fno-tree-fre
112823	gcc	other	   unassigned	[11 only] -Wincompatible-pointer-types errors in libiberty/simple-object-mach-o.c (missing backport for gcc-11)
112891	gcc	target	   unassigned	[11/12/13/14 Regression] Missing vzeroupper insert
114049	gcc	target	   unassigned	gcc.dg/framework-1.c FAILs with Xcode 15.3 beta 3
114098	gcc	target	   unassigned	_tile_loadconfig doesn't work
114521	gcc	target	   unassigned	[11 only] aarch64: wrong code with Neon ld1/st1x4 intrinsics gcc-11 and earlier
115261	gcc	rtl-opti   unassigned	[11/12/13/14/15 regression] FAIL: gcc.target/s390/vector/vec-abi-vararg-1.c
115269	gcc	libstdc+   unassigned	Hardcoded links in 14.1 docs to pages from release 4.3.2
115870	gcc	tree-opt   unassigned	Inlining of different template instances wrongly produces infinite loop
103715	gcc	fortran	   anlauf	[11/12/13/14 Regression] ICE in gfc_find_gsymbol, at fortran/symbol.c:4301 since r9-3803-ga5fbc2f36a291cbe
111837	gcc	fortran	   anlauf	[11/12/13/14 Regression] Out of bounds access with optimization inside io-implied-do-control
114474	gcc	fortran	   anlauf	[11/12/13/14 Regression] DATA statement with derived type, pointer component rejected
113979	gcc	ada	  ebotcazou	[11/12/13/14 regression] bogus error on allocator for array type with Dynamic_Predicate
103506	gcc	fortran	  jvdelisle	[11 Regression] ICE in gfc_free_namespace, at fortran/symbol.c:4039 since r10-2798-ge68a35ae4a65d2b3
107397	gcc	fortran	  jvdelisle	[11/12 Regression] ICE in gfc_arith_plus, at fortran/arith.cc:654
91035	gcc	target	   krebbel	[11/12/13/14 Regression] gotools fails to build on s390x-linux-gnu
84006	gcc	fortran	   pault	[11/12 Regression] ICE in storage_size() with CLASS entity
89462	gcc	fortran	   pault	[11/12/13 Regression] gfortran loops in code generation
93678	gcc	fortran	   pault	[11/12/13 Regression] ICE with TRANSFER and typebound procedures
103312	gcc	fortran	   pault	[11/12 Regression] ICE in gfc_find_component since r9-1098-g3cf89a7b992d483e
103368	gcc	fortran	   pault	[11/12/13 Regression] ICE in gimplify_expr, at gimplify.c:15668 since r12-4464-g017665f63047ce47
103716	gcc	fortran	   pault	[11/12/13 Regression] ICE in gimplify_expr, at gimplify.c:15964 since r9-3803-ga5fbc2f36a291cbe
106999	gcc	fortran	   pault	[11/12/13 Regression] ICE tree check: expected record_type or union_type or qual_union_type, have function_type in gfc_class_data_get, at fortran/trans-expr.cc:233
71703	gcc	fortran	 unassigned	[11 Regression] [OOP] ICE in wide_int_to_tree, at tree.c:1488
89925	gcc	fortran	 unassigned	[11 Regression] Wrong array bounds from ALLOCATE with SOURCE or MOLD
99183	gcc	fortran	 unassigned	[11 Regression] Incompatible Runtime types
99757	gcc	c++	 unassigned	[11/12/13/14 Regression] ICE: in cp_finish_decl, at cp/decl.c:7736
104391	gcc	fortran	 unassigned	[11 Regression] bind(C) and allocatable or pointer attribute don't work
104908	gcc	fortran	 unassigned	[11/12/13/14 Regression] incorrect Fortran out-of-bound runtime error.
113179	gcc	middle-e unassigned	[11/12/13/14/15 Regression] MIPS: INS is used for long long, before SLL
80774	gcc	fortran	   vehre	[11/12/13/14/15 Regression][Coarray] ICE in gfc_conv_descriptor_data_get, at fortran/trans-array.c
82904	gcc	fortran	   vehre	[11/12/13/14/15 Regression][Coarray] ICE in make_ssa_name_fn, at tree-ssanames.c:261
111880	gcc	fortran	   anlauf	[11/12/13/14] False positive warning of obsolescent COMMON block with Fortran submodule
61527	gcc	fortran	 unassigned	[11/12/13/14 Regression] [OOP] class/extends, multiple generic assignment, accept invalid

(From OE-Core rev: 7806e21e7d47fd010872a3967e51bcacdae3a76b)

Signed-off-by: Deepthi Hemraj <Deepthi.Hemraj@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-10-07 05:43:22 -07:00
Peter Marko
93ef091fb2 gcc-runtime: remove bashism
Debian 12 no longer supports replacing dash with bash as default shell.
Therefore to achieve compatibility with Debian 12, all bashisms need
to be removed.

Shell comparison via == gives an error with dash and thus the condition
is always false.

(From OE-Core rev: 3723b26f82219ff71823335d550dbf29086d63d4)

(From OE-Core rev: c6cafd2aa50357c80fbab79741d575ff567c5766)

Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-08-05 06:02:01 -07:00
Claus Stovgaard
de3d966d73 gcc: Backport sanitizer fix for 32-bit ALSR
When using the gcc-sanitizers as part of the SDK on a Linux with a newer
kernel, the ASAN fails randomly. This was seen on Ubuntu 22.04.

This is also described at
https://stackoverflow.com/questions/77894856/possible-bug-in-gcc-sanitizers

Backport the fix from LLVM project, as gcc has not yet backported
anything for the 11 series.

(From OE-Core rev: 7af8e24d6c60a01e398b10a57939947fb156feec)

Signed-off-by: Claus Stovgaard <claus.stovgaard@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-04-05 07:23:59 -07:00
Peter Marko
d803ca6531 gcc-shared-source: ignore CVE-2023-4039
Concept of gcc-source prevents cve-check to detect existing
CVE patch file.
So ignore this CVE in all recipes using gcc-source via this
include file.

(From OE-Core rev: 04511734c6dc8c7dda3a943b385cd273d012d8c7)

Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-02-09 03:46:50 -10:00
Ross Burton
f15ebb2af3 gcc: Fix -fstack-protector issue on aarch64
This series of patches fixes deficiencies in GCC's -fstack-protector
implementation for AArch64 when using dynamically allocated stack space.
This is CVE-2023-4039.  See:

https://developer.arm.com/Arm%20Security%20Center/GCC%20Stack%20Protector%20Vulnerability%20AArch64
https://github.com/metaredteam/external-disclosures/security/advisories/GHSA-x7ch-h5rf-w2mf

for more details.

(From OE-Core rev: e6592fc8308240872300a6295162e14d54c5a905)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-09-23 05:26:15 -10:00
Steve Sakoman
ab9b43f60b gcc: fix runpath errors in cc1 binary
The runpath in the cc1 binary is:

Library runpath: [$ORIGIN/../../../recipe-sysroot-native/usr/lib:$ORIGIN/../../../recipe-sysroot-native/lib]

This does not match the actual location of the libraries, which would require:

Library runpath: [$ORIGIN/../../recipe-sysroot-native/usr/lib:$ORIGIN/../../recipe-sysroot-native/lib]

Prior to gcc 9.1 the recipe set B explicity with:

B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}"

and this build directory structure matches the runpath in cc1, so there is no issue.

This line was commented out in versions 9.1 through 11.3.  The upgrade to 12.1 once
again uncommented this line.

As a result the runpath is incorrect in version 9.1 through 11.3 and cc1 defaults
to using host libraries.

This patch restores setting B as done in master and versions prior to 9.1

(From OE-Core rev: b6f4b3d43a399c2b446754de56ebea35657e13de)

Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-08-07 04:40:44 -10:00
Sundeep KOKKONDA
e8c1d3e07e gcc : upgrade to v11.4
gcc stable version upgraded from v11.3 to v11.4

For changes in v11.4 see - https://gcc.gnu.org/gcc-11/changes.html

Below is the bug fix list for v11.4
https://gcc.gnu.org/bugzilla/buglist.cgi?bug_status=RESOLVED&order=short_desc%2Cbug_status%2Cpriority%2Cassigned_to%2Cbug_id&query_format=advanced&resolution=FIXED&target_milestone=11.4

There are a total 115 bugs are fixed in this release, below is the list of bugs fixed excluding the regression fixes.

ID	Product	Comp	    Resolution	Summary▲
108199	gcc	tree-opt	FIXE	Bitfields, unions and SRA and storage_order_attribute
107801	gcc	libstdc+	FIXE	Building cross compiler for H8 family fails in libstdc++ (c++17/memory_resource.cc)
108265	gcc	libstdc+	FIXE	chrono::hh_mm_ss can't be constructed from unsigned durations
104443	gcc	libstdc+	FIXE	common_iterator<I, S>::operator-> is not correctly implemented
98056	gcc	c++		FIXE	coroutines: ICE tree check: expected record_type or union_type or qual_union_type, have array_type since r11-2183-g0f66b8486cea8668
107061	gcc	target		FIXE	ENCODEKEY128 clobbers xmm4-xmm6
105433	gcc	testsuit	FIXE	FAIL: gcc.target/i386/iamcu/test_3_element_struct_and_unions.c
105095	gcc	testsuit	FIXE	gcc.dg/vect/complex/fast-math-complex-* tests are not executed
100474	gcc	c++		FIXE	ICE: in diagnose_trait_expr, at cp/constraint.cc:3706
105854	gcc	target		FIXE	ICE: in extract_constrain_insn, at recog.cc:2692 (insn does not satisfy its constraints: sse2_lshrv1ti3)
104462	gcc	target		FIXE	ICE: in extract_constrain_insn_cached, at recog.cc:2682 with -mavx512fp16 -mno-xsave
106045	gcc	libgomp		FIXE	Incorrect testcase in libgomp.c/target-31.c at -O0
56189	gcc	c++		FIXE	Infinite recursion with noexcept when instantiating function template
100295	gcc	c++		FIXE	Internal compiler error from generic lambda capturing parameter pack and expanding it in if constexpr
100613	gcc	jit		FIXE	libgccjit should produce dylib on macOS
104875	gcc	libstdc+	FIXE	libstdc++-v3/src/c++11/codecvt.cc:312:24: warning: left shift count >= width of type
107471	gcc	libstdc+	FIXE	mismatching constraints in common_iterator
105284	gcc	libstdc+	FIXE	missing syncstream and spanstream forward decl. in <iosfwd>
98821	gcc	c++		FIXE	modules : c++tools configures with CC but code fragments assume CXX.
109846	gcc	fortran		FIXE	Pointer-valued function reference rejected as actual argument
101324	gcc	target		FIXE	powerpc64le: hashst appears before mflr at -O1 or higher
102479	gcc	c++		FIXE	segfault when deducing class template arguments for tuple with libc++-14
105128	gcc	libstdc+	FIXE	source_location compile error for latest clang 15
106183	gcc	libstdc+	FIXE	std::atomic::wait might fail to be unblocked by notify_one/all on platforms without platform_wait()
102994	gcc	libstdc+	FIXE	std::atomic<ptr>::wait is not marked const
105324	gcc	libstdc+	FIXE	std::from_chars() assertion at floating_from_chars.cc:78 when parsing 1.11111111....
105375	gcc	libstdc+	FIXE	std::packaged_task has no deduction guide.
104602	gcc	libstdc+	FIXE	std::source_location::current uses cast from void*
106808	gcc	libstdc+	FIXE	std::string_view range concept requirement causes compile error with Boost.Filesystem
105725	gcc	c++		FIXE	[ICE] segfault with `-Wmismatched-tags`
105920	gcc	target		FIXE	__builtin_cpu_supports ("f16c") should check AVX

(From OE-Core rev: 4fd7e5951c42336729f12cde71450ec298f2078b)

Signed-off-by: Sundeep KOKKONDA <sundeep.kokkonda@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-08-07 04:40:44 -10:00
Richard Purdie
55e4c90abf gcc-testsuite: Fix ppc cpu specification
After this change in qemu:

c7e89de132

there is no 'max' cpu model on ppc. Drop it to clean up ppc gcc testsuite failures.

In order for this to work we do need to pull in the alternative cpu option from
QEMU_EXTRAOPTIONS on powerpc.

(From OE-Core rev: 3a1b9f300a796e1216d0094043dba7b0f39ec869)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit c447f2b21b20fb2b1829d540af2cc0bf8242700c)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-07-26 05:20:36 -10:00
Ross Burton
8585e78965 gcc: don't pass --enable-standard-branch-protection
By changing the default code generation of GCC we're inadvertently
breaking the GCC test suite, which has ~120K+ more failures when run for
aarch64 compared to x86-64.

This was because the generated code fragments included the BTI
instructions, which the test case wasn't expecting.  We can't tell the
tests globally to run without branch protection, as that will break the
tests which also turn it on.

Remove the enabling of branch protection by standard in GCC, we'll
enable it in the tune files instead.

(From OE-Core rev: 759327cf6bd79118bae0c68e63742ae4721471d8)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit bb4b9017db6a893ed054a2d2ad4cc671dec09c42)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-07-26 05:20:36 -10:00
Khem Raj
645fd39e4b gcc-runtime: Use static dummy libstdc++
some standalone targets e.g. riscv64-elf disable shared linking for
baremetal ELF ABI in ld, therefore lets make it a static library

(From OE-Core rev: 3c6219dfcbcbde314648ba8cc54a90b32ea1c952)

(From OE-Core rev: 4ee9d5839669560ec10f23445fa8bbc03a4c5406)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-05-30 04:11:15 -10:00
Peter Marko
739b324c24 gcc-shared-source: do not use ${S}/.. in deploy_source_date_epoch
This function is referencing '${S}/..'.
It uses ${S} only as good known directory path to start
traversing from, and it does not need it to exist or be populated.
If ${S} does not exist yet, the function will fail because
it cannot evaluate path .. from non-existing directory.

Reproducer (verified in master and kirkstone):
  bitbake gcc -c deploy_source_date_epoch
  bitbake gcc -c cleansstate
  rm -rf build/tmp
  bitbake gcc -c deploy_source_date_epoch

(From OE-Core rev: 728018bbfe1de53661881a05e0359083ad544f97)

Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit 42661a59cda164b2d236ffc35b4d8cf43312b677)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-04-11 11:31:52 +01:00
Pavel Zhukov
2453dfa90a gcc: Refactor linker patches and fix linker on arm with usrmerge
Backport fix from master to allow gcc to use proper linker path for
musl [Yocto #14977].

Fixes:
| qemu-arm: Could not open '/lib/ld-musl-armhf.so.1': No such file or directory

(From OE-Core rev: d821a602c56a8d0c8171ee0d2ce31613121be3a6)

Signed-off-by: Pavel Zhukov <pavel@zhukoff.net>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-01-26 23:37:05 +00:00
Richard Purdie
9a3bc4c51a gcc-source: Ensure deploy_source_date_epoch sstate hash doesn't change
Currently if you switch machines, gcc-source do_deploy_source_date_epoch
would re-run as the stamps are tune specific. This hasn't caused much
of an issue until now, however if we fix the gcc recipes to reuse the
timestamp from this task, it does then create problems.

Copy code from allarch to ensure this task hash doesn't change between
machines/tunes.

(From OE-Core rev: 1511cb3bae2d6e2dad48269108e68967ae302efc)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit 7e052d03464ba5e880a6c5a0e45ff2f467ef97e8)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-11-24 15:30:01 +00:00
Richard Purdie
cb85229e3d gcc-source: Drop gengtype manipulation
Whilst we patch gengtype.cc, we don't patch gengtype-lex.cc which would
be the file which would trigger regeneration of files.

The real bug that was likely the cause for this fix is probably SDE issues
with gcc shared workdir so this code can now be dropped.

(From OE-Core rev: 8a49626bb32b40a2cf97fd8b80564b494ae38698)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit 7ab82b5db2a737c2a0266280b15d343a27c0e1d5)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-11-24 15:30:01 +00:00
Richard Purdie
6ad627fe87 gcc-source: Fix gengtypes race
gcc renamed .c files to .cc files:

https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=5c69acb32329d49e58c26fa41ae74229a52b9106

but we didn't fix this reference which meant we re-introduced a race around
gengtypes-lex.c. This lead to the race reappearing on the autobuilder. Fix
the naming to avoid the problem again.

[YOCTO #14953]

(From OE-Core rev: ac7d5ea832c880002fd466360294ffb357e9c56c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit dbca40ed399405b663dbc3894e35596a2615f47d)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-11-24 15:30:01 +00:00
Richard Purdie
58ca943f91 gcc-shared-source: Fix source date epoch handling
The source date epoch for gcc isn't being transferred from the shared
workdir to the current WORKDIR for the specific recipe. This results in
the clamping code within sstate.bbclass using a value from 2011 which
changes the timestamps of many files. Since this happens part way
through the build, if pieces of gcc haven't built, or build/rebuild
later, we see things rebuilding when they should not and for generated
files, races are possible.

Fix this by copying the SDE from the shared workdir into the recipe
workdir.

[YOCTO #14953]

(From OE-Core rev: 0511f24264bcc27d6b61edd2e16f899c985eb8ad)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit b996293b4c8ab7ff3ed852045d17290df29205df)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-11-24 15:30:01 +00:00
Ruiqiang Hao
1e779dbf2a gcc: add arm-v9 support
Backport some patches from GCC 12 to support arm-v9.

(From OE-Core rev: 450639bf4b46b963480b2ab4efe72e443d0524b3)

Signed-off-by: Ruiqiang Hao <Ruiqiang.Hao@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-09-28 08:02:11 +01:00
Samuli Piippo
864e65f0f1 gcc-cross-canadian: add default plugin linker
Fix multilib sdk issue where gcc is unable to find linker. Previous
fix was in cdd86896c8d29135f937968e9aa07f919cf543d3 using real-ld
symlink, but that prevented switching between bfd and gold linkers.

Running compiler with debug arguments shows that collect2 tries and
fails to find linker using the multilib triples:

  $ $CC -v -Wl,-debug
  ...
  Looking for 'real-ld'
  Looking for 'collect-ld'
  Looking for 'mips-oemllib32-linux-ld'
  Looking for 'mips-oe-linux-mips-oemllib32-linux-ld'
  ...
  collect2 version 12.2.0
  ld_file_name        = not found
  ...
  collect2: fatal error: cannot find ‘ld’

Using --with-plugin-ld=ld in gcc-cross-canadian builds to set default
linker name for collect2, lets it find the linker correctly:

  Looking for 'real-ld'
  Looking for 'collect-ld'
  Looking for 'ld'
  ...
  collect2 version 12.2.0
  ld_file_name        = /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/libexec/mips-oe-linux/gcc/mips-oe-linux/12.2.0/ld

Swith between bfd and gold linker works as expected now:

  $ $CC -v -Wl,-debug -fuse-ld=gold
  ...
  Looking for 'real-ld'
  Looking for 'collect-ld'
  Looking for 'ld.gold'
  ...
  collect2 version 12.2.0
  ld_file_name        = /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/libexec/i686-oe-linux/gcc/i686-oe-linux/12.2.0/ld.gold

(From OE-Core rev: f4174b3bde5ec91293619fac3258f35153363c51)

Signed-off-by: Samuli Piippo <samuli.piippo@qt.io>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit cf1bb16b7f9f81514feaf1e4ecffd9039387bb89)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-09-28 08:02:11 +01:00
Samuli Piippo
27086f89c8 Revert "gcc-cross-canadian: Add symlink to real-ld alongside other symlinks"
This reverts commit cdd86896c8d29135f937968e9aa07f919cf543d3.

real-ld is always used if that is found, which means you cannot
switch between bfd and gold linkers using -fuse-ld gcc option.

(From OE-Core rev: 3d13ef9e457ad3854c5e9bc37f8ea9a6b0e6c54f)

Signed-off-by: Samuli Piippo <samuli.piippo@qt.io>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 53ae417c63a4a7ff4a729d3653a31cf1c0758f10)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-09-28 08:02:11 +01:00
Richard Purdie
1cee07e8e9 gcc-multilib-config: Fix i686 toolchain relocation issues
This code wasn't changing the linux.h on i686. Make the entry match that
for i586 which was correct.

This fixes problems where the wrong dynamic loader path was used by
nativesdk-gcc on i686 SDK targets by ensuring SYSTEMLIBS_DIR is replaced
by %r in the correct header files.

(From OE-Core rev: 47f6d0da703a9d25fa7dd36793ba332ae8d7ee9e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit d30eb681f41bf9e921f7f0d42747fff7a4be9229)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-09-16 17:53:22 +01:00
Khem Raj
33a1bfc66b libgcc: Fix standalone target builds with usrmerge distro feature
Ignore the rmdir cmd if using usrmerge distro feature since the
intention is to delete /lib or /lib64 but not libdir under /usr and
base_libdir = libdir when usrmerge is enabled in distro

(From OE-Core rev: 38fb876253e28577b8fcf4dd47fbb1d0673c6220)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 3b7f6b0e0f1f16f89cd924aac001b4f661c145ca)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-08 16:23:37 +01:00
Khem Raj
27fde9cc2a gcc-runtime: Pass -nostartfiles when building dummy libstdc++.so
This is a dummy shared object therefore reduce dependencies further by
not requiring the C startup files, we wont use this shared library for
anything useful anyway

(From OE-Core rev: 2bc86c029fb82ae572f6a89407ccfe332972568c)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Pavel Zhukov <pavel.zhukov@huawei.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-01 16:27:30 +01:00
Naveen
35b74ace9c gcc: Backport a fix for gcc bug 105039
Backport a fix from:
https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=9234cdca6ee88badfc00297e72f13dac4e540c79

which fixes rust recursion issues in the demangler.

(From OE-Core rev: 943760dfb8036bd2f5e075bf0696f820fd6dc79d)

Signed-off-by: Naveen <naveen.gowda@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-01 16:27:30 +01:00
Richard Purdie
17421c1fe2 gcc-runtime: Fix missing MLPREFIX in debug mappings
This fixes reproducibility issues with multilibs were a different recipe
specific sysroot is used which was leaking into debug symbols in libraries.

(From OE-Core rev: 3bb7abe545be6c92b2bd4f184536b0b0e871aac6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit f442edf51e256bd315bd8e4ac4d9fa12b8e9e092)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-07-25 15:11:46 +01:00
Richard Purdie
3af7f4ba99 gcc-runtime: Fix build when using gold
If gold is enabled as the default linker, it errors trying to link
to our dummy library empty file and this turns off things which should
be present in libstdc++.

For example, _GLIBCXX_HAVE_S_ISREG isn't defined and HAVE_S_ISREG in
libstdc++-v3/config.h isn't set properly.

Instead of just creating an empty file, create an empty elf binary
instead which addresses the issue.

(From OE-Core rev: f842dbc478cb007b5f3e2f016959e2b597a4d0be)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 2070bcd10aa3a05c96c8501c6a8c1e129fb1d440)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-07-25 15:11:46 +01:00
Richard Purdie
7139d8d63b gcc-source: Fix incorrect task dependencies from ${B}
Some tasks may reference ${B} for gcc-source which in general would not exist.
It has dependencies on HOST_SYS and TARGET_SYS which are not appropriate for a
shared recipe like gcc-source. This causes problems for the archiver and
multiconfigs in particlar.

Set B to something else to avoid these task hash issues.

Acked-by: Jose Quaresma <jose.quaresma@foundries.io>
(From OE-Core rev: 7211a6fb51ef0e7f5c919f98a33eaf8094b9c814)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit beb2a76c591e985c6fc7ed473abd1bee27f955a2)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-22 23:46:29 +01:00
Richard Purdie
8c33c7efbe gcc-cross-canadian: Add nativesdk-zstd dependency
To match the changes to gcc-cross, add a nativesdk-zstd dependency to ensure
our configurations match.

(From OE-Core rev: be70f51806d66daf1994a492dc446062838c0e21)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit c145e00710fe557b5a3832fdc556ad53434b3615)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-11 10:06:13 +01:00
Jeremy Puhlman
94ea8b8461 gcc: depend on zstd-native
Sharing sstate cache binaries between two systems, one with libzstd installed
and the other without, leads to various gcc components being linked against
the system libzstd and failing to run on the system with out it installed.

Make zstd-native from our system available.

(From OE-Core rev: 0efcba381d51a9ab8519c3d50a8b48181a0e38e4)

Signed-off-by: Jeremy A. Puhlman <jpuhlman@mvista.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 2b0a6f03137f24b211c8881cebf65732e550a942)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-11 10:06:13 +01:00
Khem Raj
45d7615dfe gcc: Upgrade to 11.3 release
This is a bugfix release on gcc-11 series, fixes 189 bugs [1]
Drop backported patches already included in 11.3 release

[1] https://gcc.gnu.org/bugzilla/buglist.cgi?bug_status=RESOLVED&resolution=FIXED&target_milestone=11.3

(From OE-Core rev: e63013cc38b82659658365da53b14952711d6701)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-07 11:53:26 +01:00
Sundeep KOKKONDA
99bcad583a gcc: sanitizer: Fix tsan against glibc 2.34
The patch is needed in order to support recent glibc (2.34).

libsanitizer/ChangeLog:
	PR sanitizer/101749
        * sanitizer_common/sanitizer_posix_libcdep.cpp: Prevent
	generation of dependency on _cxa_guard for static
	initialization.

(From OE-Core rev: c44c4e7fb3c860d9fcb2aada0c9d4acb1e1e8101)

Signed-off-by: Sundeep KOKKONDA <sundeep.kokkonda@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-03 11:29:05 +01:00
Peter Kjellerstedt
83766c9fff meta, meta-selftest: Replace more non-SPDX license identifiers
In commit ceda3238 (meta/meta-selftest/meta-skeleton: Update LICENSE
variable to use SPDX license identifiers) all LICENSE variables were
updated to only use SPDX license identifiers.

This does the same for comments and other variables where it is
appropriate to use the official SPDX license identifiers. There are
still references to, e.g., "GPLv3", but they are then typically in
descriptive text where they refer to the license in a generic sense.

(From OE-Core rev: 165759dced7fbe73b1db2ede67047896071dc6d0)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-01 23:44:59 +00:00
Richard Purdie
71ef319193 meta/scripts: Automated conversion of OE renamed variables
(From OE-Core rev: aa52af4518604b5bf13f3c5e885113bf868d6c81)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-21 23:37:27 +00:00
Richard Purdie
b0130fcf91 meta/meta-selftest/meta-skeleton: Update LICENSE variable to use SPDX license identifiers
An automated conversion using scripts/contrib/convert-spdx-licenses.py to
convert to use the standard SPDX license identifiers. Two recipes in meta-selftest
were not converted as they're that way specifically for testing. A change in
linux-firmware was also skipped and may need a more manual tweak.

(From OE-Core rev: ceda3238cdbf1beb216ae9ddb242470d5dfc25e0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-20 16:45:25 +00:00
Stefan Herbrechtsmeier
2e5720c573 gcc-target: move cc1plus to g++ package
Move cc1plus from gcc to g++ package. Therefor, remove the duplicate
FILES entry from gcc package and keep the entry in g++ package.

(From OE-Core rev: f16c0efdeaca7cd08bd5609141b1094139e746f9)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-12 17:05:35 +00:00
Stefan Herbrechtsmeier
21adae4959 gcc-target: fix glob to remove gcc-<version> binary
The glob to remove the gcc-<version> binary expects a single-digit major
version which is no longer true.

(From OE-Core rev: 30de10cf939cf65c0cab6730a3575bced5c7533a)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-12 17:05:35 +00:00
pgowda
38cc7a1457 gcc : Fix CVE-2021-46195
Upstream-Status: Backport [https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=f10bec5ffa487ad3033ed5f38cfd0fc7d696deab]

(From OE-Core rev: 81e9f8aedab70dfb0a016601150623ef9a7c1596)

Signed-off-by: pgowda <pgowda.cve@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-12 17:05:35 +00:00
Richard Purdie
2d940dd5bf gcc: Drop stdlib++ option patch
The patch to gcc to disable use of libstdc++ when configuring the library
during gcc-runtime is old and there are perhaps better ways to do this now.

If removed, most builds still "work" but incorrect values for things like
atomic ops are found during configure. mips64 and ppc fail with on target
simple tests of g++ in testimage.

Instead we can create a dummy libstdc++ which allows the correct configure
test results to be obtained.

Discussed with upstream about the patch are ongoing, if accepted, we can
switch back to the commandline option if it is added in future.

(From OE-Core rev: 34b0edb0d3120c32063ff7e3dd52be20d60401d5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-05 12:26:35 +00:00
Alejandro Hernandez Samaniego
d4b186c2cf gcc-cross-canadian: Fix cross canadian compiler for baremetal targets
While building GCC it checks whether the include directory exists,
if it doesnt it throws an error and exits:

| The directory that should contain system headers does not exist:
| tmp/work/x86_64-nativesdk-pokysdk-linux/gcc-cross-canadian-riscv32/
    11.2.0-r0/recipe-sysroot/usr/include/
| make[1]: *** [Makefile:3257: stmp-fixinc] Error 1

Even though for the baremetal toolchain not having this directory
does make sense.

We overcame this by removing the --with-sysroot=/not/exist argument
for baremetal toolchains (via TARGET_OS override), however, the
newlib toolchain does have headers and an includedir, hence by fixing
the baremetal toolchain we broke the newlib one since it uses the same
TARGET_OS as baremetal, causing for example (on newlib):

/sdk/sysroots/x86_64-pokysdk-linux/usr/lib/riscv32-poky-elf/gcc/
    riscv32-poky-elf/11.2.0/include/stdint.h:9:16:
fatal error: stdint.h: No such file or directory

| # include_next <stdint.h>
                 ^~~~~~~~~~
compilation terminated.

By creating a dummy includedir, and removing the previous fix we
allow GCC to be built the same way, unifying the cross compiler
for all targets.

After this fix both TCLIBC=baremetal and TCLIBC=newlib SDKs work
properly.

(From OE-Core rev: 08ff7c87efdf373f1874fcccd9a2a73fc0efef30)

Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro@enedino.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-01-12 07:19:35 +00:00
Andrei Gherzan
97dd81b556 gcc: Fix typo in linux64.h install patch
The "gcc: Fix compile of gcc plugins" patch had a typo making it a noop.
This was due to a rework to make it specific to the linux64.h header.

(From OE-Core rev: 5f0f00f0988c02d7fe0fa62edf3e4901ce9941a6)

Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-01-11 15:48:10 +00:00
Andrei Gherzan
eb5f3fb2f8 gcc: Fix compile of gcc plugins
Without this, compiling gcc plugins will fail with an error similar to:
[...]
fatal error: ./config/i386/linux64.h: No such file or directory
[...]

In Yocto, we set up compiling gcc-cross out of tree. Which in turn makes
the generated headers end up in B. The tm.h header will include
generated headers that are expected in plugin/include/config/*.

For example, the linux64.h header, when generating gcc-cross for x86-64,
will end up in tm.h header as:

include "./config/i386/linux64.h"

On the other hand, the make rule `install-plugin` in gcc/Makefile.in
will install the linux64.h assuming that it is generated in the sources
directory and because this is not the case in our setup, the Makefile
ends up installing it in plugin_includedir/`basename $$path` which ends
up installing the header in [..]plugin/include as opposed to
[..]plugin/include/config/i386 (as expected by the generator of tm.h).

The included patch modifies the Makefile rule to match the assumption of
gcc-cross being compiled out of tree.

(From OE-Core rev: 92167f8e02bb6fbbe1ee6a6678525a0ae27b00a5)

Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-01-07 14:39:17 +00:00
Khem Raj
06b027b928 gcc: Update status of musl stddef.h patch
This patch has been accepted upstream

(From OE-Core rev: 4c644708798f258d45dbcfa01909626de32710d4)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-12-21 12:01:41 +00:00
pgowda
bbaf30ef53 gcc: Fix CVE-2021-42574
Upstream-Status: Backport [https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=bd5e882cf6e0def3dd1bc106075d59a303fe0d1e]
Upstream-Status: Backport [https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=51c500269bf53749b107807d84271385fad35628]
Upstream-Status: Backport [https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=1a7f2c0774129750fdf73e9f1b78f0ce983c9ab3]
Upstream-Status: Backport [https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=bef32d4a28595e933f24fef378cf052a30b674a7]

(From OE-Core rev: 1276fa8b501aee1561b77538219d3cad2c796a21)

Signed-off-by: pgowda <pgowda.cve@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-12-17 09:56:14 +00:00
Richard Purdie
eea1eeb4ec gcc: Add CVE-2021-37322 to the list of CVEs to ignore
The CVE applies to binutils 2.26 and not to gcc so ignore there.

(From OE-Core rev: fea2726663a3db03170c49fceaffc632c509aeea)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-12-09 10:33:25 +00:00
Richard Purdie
6245f65fa3 gcc: Update patch status submitted->backport
Patch was merged to upstream gcc, update status.

(From OE-Core rev: ece8f1471db443d4844d475af9c89d16ef3fbab3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-12-06 11:21:52 +00:00
Richard Purdie
80cd0b8a52 gcc: Drop further unneeded precompiled header patch
According to comments on the bug report from gcc developers, we
no longer need to do this post gcc 10. Lets therefore drop the patch.

(From OE-Core rev: 8ddc6f46d40cdcc462de23d1b1218f2ed9fd3d07)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-26 17:01:08 +00:00
Richard Purdie
921d3aa667 gcc: Drop mips default ABI patch
gcc-configure-common.inc already sets --with-abi=64 for our mips64
targets so this patch is no longer needed.

[YOCTO #14639]

(From OE-Core rev: e0010af733825ed1050fd3342cf3ef1c478df1a0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-26 17:01:08 +00:00