require gcc-common.inc

# Third digit in PV should be incremented after a minor release

PV = "12.2.0"

# BINV should be incremented to a revision after a minor gcc release

BINV = "12.2.0"

FILESEXTRAPATHS =. "${FILE_DIRNAME}/gcc:${FILE_DIRNAME}/gcc/backport:"

DEPENDS =+ "mpfr gmp libmpc zlib flex-native"
NATIVEDEPS = "mpfr-native gmp-native libmpc-native zlib-native flex-native zstd-native"

LICENSE = "GPL-3.0-with-GCC-exception & GPL-3.0-only"

LIC_FILES_CHKSUM = "\
    file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
    file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \
    file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6 \
    file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1 \
    file://COPYING.RUNTIME;md5=fe60d87048567d4fe8c8a0ed2448bcc8 \
"
# from git
#RELEASE ?= "7092b7aea122a91824d048aeb23834cf1d19b1a1"
#BASEURI ?= "https://repo.or.cz/official-gcc.git/snapshot/${RELEASE}.tar.gz;downloadfilename=gcc-${PV}-${RELEASE}.tar.gz"
#SOURCEDIR ?= "official-gcc-${@'${RELEASE}'[0:7]}"

# from snapshot
#RELEASE ?= "12.1.0-RC-20220429"
#SOURCEDIR ?= "gcc-${RELEASE}"
#BASEURI ?= "https://gcc.gnu.org/pub/gcc/snapshots/${RELEASE}/gcc-${RELEASE}.tar.xz"

# official release
RELEASE ?= "${PV}"
BASEURI ?= "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.xz"
SOURCEDIR ?= "gcc-${PV}"

SRC_URI = "${BASEURI} \
           file://0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch \
           file://0002-gcc-poison-system-directories.patch \
           file://0003-64-bit-multilib-hack.patch \
           file://0004-Pass-CXXFLAGS_FOR_BUILD-in-a-couple-of-places-to-avo.patch \
           file://0005-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch \
           file://0006-cpp-honor-sysroot.patch \
           file://0007-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch \
           file://0008-libtool.patch \
           file://0009-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch \
           file://0010-Use-the-multilib-config-files-from-B-instead-of-usin.patch \
           file://0011-Avoid-using-libdir-from-.la-which-usually-points-to-.patch \
           file://0013-Ensure-target-gcc-headers-can-be-included.patch \
           file://0014-Don-t-search-host-directory-during-relink-if-inst_pr.patch \
           file://0015-libcc1-fix-libcc1-s-install-path-and-rpath.patch \
           file://0016-handle-sysroot-support-for-nativesdk-gcc.patch \
           file://0017-Search-target-sysroot-gcc-version-specific-dirs-with.patch \
           file://0018-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch \
           file://0019-Re-introduce-spe-commandline-options.patch \
           file://0020-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch \
           file://0021-gentypes-genmodes-Do-not-use-__LINE__-for-maintainin.patch \
           file://0023-libatomic-Do-not-enforce-march-on-aarch64.patch \
           file://0024-Fix-install-path-of-linux64.h.patch \
           file://0026-rust-recursion-limit.patch \
           file://prefix-map-realpath.patch \
           file://hardcoded-paths.patch \
       file://0001-Daily-bump.patch \
       file://0002-Daily-bump.patch \
       file://0003-Daily-bump.patch \
       file://0004-Daily-bump.patch \
       file://0005-OpenMP-Fix-var-replacement-with-simd-and-linear-step.patch \
       file://0006-Fortran-OpenMP-fix-declare-simd-inside-modules-and-a.patch \
       file://0007-gcn-mkoffload-Cleanup-temporary-dbgobj-file.patch \
       file://0008-Update-gcc-.po-files.patch \
       file://0009-libstdc-Document-linker-option-for-C-23-stacktrace-P.patch \
       file://0010-Daily-bump.patch \
       file://0011-rs6000-Adjust-mov-optabs-for-opaque-modes-PR103353.patch \
       file://0012-vect-Don-t-allow-vect_emulated_vector_p-type-in-vect.patch \
       file://0013-libstdc-Fix-visit-void-v-for-non-void-visitors-PR106.patch \
       file://0014-Daily-bump.patch \
       file://0015-LoongArch-Fix-pr106459-by-use-HWIT-instead-of-1UL.patch \
       file://0016-Daily-bump.patch \
       file://0017-Don-t-gimple-fold-ymm-version-vblendvpd-vblendvps-vp.patch \
       file://0018-Fortran-improve-error-recovery-while-simplifying-siz.patch \
       file://0019-Daily-bump.patch \
       file://0020-Daily-bump.patch \
       file://0021-Daily-bump.patch \
       file://0022-ifcvt-Fix-up-noce_convert_multiple_sets-PR106590.patch \
       file://0023-c-Implement-P2327R1-De-deprecating-volatile-compound.patch \
       file://0024-i386-Fix-up-mode-iterators-that-weren-t-expanded-PR1.patch \
       file://0025-fortran-Expand-ieee_arithmetic-module-s-ieee_class-i.patch \
       file://0026-fortran-Expand-ieee_arithmetic-module-s-ieee_value-i.patch \
       file://0027-x86-Cast-stride-to-__PTRDIFF_TYPE__-in-AMX-intrinsic.patch \
       file://0028-rs6000-Allow-conversions-of-MMA-pointer-types-PR1060.patch \
       file://0029-Daily-bump.patch \
       file://0030-sve-Fix-fcmuo-combine-patterns-PR106524.patch \
       file://0031-c-__has_builtin-gives-the-wrong-answer-PR106759.patch \
       file://0032-Fortran-OpenMP-Fix-strictly-structured-blocks-parsin.patch \
       file://0033-Update-gcc-sv.po.patch \
       file://0034-Daily-bump.patch \
       file://0035-Daily-bump.patch \
       file://0036-Fix-up-dump_printf_loc-format-attribute-and-adjust-u.patch \
       file://0037-Daily-bump.patch \
       file://0038-AArch64-Fix-bootstrap-failure-due-to-dump_printf_loc.patch \
       file://0039-arm-correctly-handle-misaligned-MEMs-on-MVE-PR105463.patch \
       file://0040-cselib-add-function-to-check-if-SET-is-redundant-PR1.patch \
       file://0041-Daily-bump.patch \
       file://0042-rs6000-Don-t-ICE-when-we-disassemble-an-MMA-variable.patch \
       file://0043-Daily-bump.patch \
       file://0044-Daily-bump.patch \
       file://0045-Fortran-Fix-ICE-with-fcheck-pointer-PR100136.patch \
       file://0046-Daily-bump.patch \
       file://0047-Daily-bump.patch \
       file://0048-libstdc-Check-for-overflow-in-regex-back-reference-P.patch \
       file://0049-libstdc-Fix-for-explicit-copy-ctors-in-thread-and-fu.patch \
       file://0050-Daily-bump.patch \
       file://0051-RTEMS-Add-mvrsave-multilibs.patch \
       file://0052-Daily-bump.patch \
       file://0053-tree-optimization-106809-compile-time-hog-in-VN.patch \
       file://0054-tree-optimization-106841-gather-and-hybrid-SLP.patch \
       file://0055-tree-optimization-106860-fix-profile-scaling-in-spli.patch \
       file://0056-Daily-bump.patch \
       file://0057-Daily-bump.patch \
       file://0058-Daily-bump.patch \
       file://0059-libstdc-Add-already-accepted-ranges-testcase-PR10632.patch \
       file://0060-c-auto-member-function-and-auto-variable-PR106893.patch \
       file://0061-c-cast-to-array-of-unknown-bound-PR93259.patch \
       file://0062-Daily-bump.patch \
       file://0063-rs6000-test-Fix-empty-TU-in-some-cases-of-effective-.patch \
       file://0064-runtime-ignore-__morestack-function-in-runtime.Calle.patch \
       file://0065-libgo-make-runtime.Version-return-a-meaningful-strin.patch \
       file://0066-Daily-bump.patch \
       file://0067-Daily-bump.patch \
       file://0068-Daily-bump.patch \
       file://0069-libstdc-Document-new-libstdc-.so-symbol-version.patch \
       file://0070-Fortran-Fix-ICE-with-automatic-reallocation-PR100245.patch \
       file://0071-Fortran-catch-NULL-pointer-dereferences-while-simpli.patch \
       file://0072-Daily-bump.patch \
       file://0073-Daily-bump.patch \
       file://0074-Daily-bump.patch \
       file://0075-Fix-PR-target-99184-Wrong-cast-from-double-to-16-bit.patch \
       file://0076-c-Stray-inform-note-with-Waddress-PR106947.patch \
       file://0077-Daily-bump.patch \
       file://0078-Daily-bump.patch \
       file://0079-rs6000-Handle-unresolved-overloaded-builtin-PR105485.patch \
       file://0080-rs6000-Fix-the-check-of-bif-argument-number-PR104482.patch \
       file://0081-aarch64-Fix-GTY-markup-for-arm_sve.h-PR106491.patch \
       file://0082-Daily-bump.patch \
       file://0083-i386-Add-syscall-to-enable-AMX-for-latest-kernels.patch \
       file://0084-Fortran-error-recovery-on-invalid-ARRAY-argument-to-.patch \
       file://0085-Update-gcc-fr.po.patch \
       file://0086-Daily-bump.patch \
       file://0087-Daily-bump.patch \
       file://0088-Daily-bump.patch \
       file://0089-Daily-bump.patch \
       file://0090-Daily-bump.patch \
       file://0091-c-family-Drop-nothrow-from-c_keywords.patch \
       file://0092-Daily-bump.patch \
       file://0093-aarch64-Add-Arm-Neoverse-V2-support.patch \
       file://0094-Daily-bump.patch \
       file://0095-OpenACC-Fix-reduction-tree-sharing-issue-PR106982.patch \
       file://0096-libstdc-Disable-volatile-qualified-std-bind-for-C-20.patch \
       file://0097-i386-Mark-XMM4-XMM6-as-clobbered-by-encodekey128-enc.patch \
       file://0098-Fortran-NULL-pointer-dereference-in-invalid-simplifi.patch \
       file://0099-Fortran-fix-ICE-in-generate_coarray_sym_init-PR82868.patch \
       file://0100-Fortran-error-recovery-while-simplifying-intrinsic-U.patch \
       file://0101-c-fix-triviality-of-class-with-unsatisfied-op.patch \
       file://0102-Daily-bump.patch \
       file://0103-Daily-bump.patch \
       file://0104-Fortran-Fix-function-attributes-PR100132.patch \
       file://0105-Fortran-Fix-automatic-reallocation-inside-select-ran.patch \
       file://0106-Daily-bump.patch \
       file://0107-Daily-bump.patch \
       file://0108-Update-gcc-sv.po.patch \
       file://0109-gcc-config-t-i386-add-build-dependencies-on-i386-bui.patch \
       file://0110-Daily-bump.patch \
       file://0111-Daily-bump.patch \
       file://0112-Daily-bump.patch \
       file://0113-Daily-bump.patch \
       file://0114-Daily-bump.patch \
       file://0115-Fortran-Fix-ICE-and-wrong-code-for-assumed-rank-arra.patch \
       file://0116-Daily-bump.patch \
       file://0117-Daily-bump.patch \
       file://0118-Add-cpplib-ro.po.patch \
       file://0119-Daily-bump.patch \
       file://0120-tree-optimization-105937-avoid-uninit-diagnostics-cr.patch \
       file://0121-tree-optimization-106892-avoid-invalid-pointer-assoc.patch \
       file://0122-tree-optimization-106922-PRE-and-virtual-operand-tra.patch \
       file://0123-tree-optimization-106934-avoid-BIT_FIELD_REF-of-bitf.patch \
       file://0124-arm-Fix-constant-immediates-predicates-and-constrain.patch \
       file://0125-Daily-bump.patch \
       file://0126-fortran-Move-the-clobber-generation-code.patch \
       file://0127-fortran-Fix-invalid-function-decl-clobber-ICE-PR1050.patch \
       file://0128-fortran-Move-clobbers-after-evaluation-of-all-argume.patch \
       file://0129-Daily-bump.patch \
       file://0130-install.texi-gcn-update-llvm-reqirements-gcn-nvptx-n.patch \
       file://0131-c-ICE-with-VEC_INIT_EXPR-and-defarg-PR106925.patch \
       file://0132-Daily-bump.patch \
       file://0133-Fix-PR-target-107248.patch \
       file://0134-Daily-bump.patch \
       file://0135-Daily-bump.patch \
       file://0136-Daily-bump.patch \
       file://0137-tree-optimization-106922-missed-FRE-PRE.patch \
       file://0138-testsuite-Fix-up-pr106922.C-test.patch \
       file://0139-tree-optimization-106922-extend-same-val-clobber-FRE.patch \
       file://0140-tree-optimization-107107-tail-merging-VN-wrong-code.patch \
       file://0141-tree-optimization-107160-avoid-reusing-multiple-accu.patch \
       file://0142-tree-optimization-107212-SLP-reduction-of-reduction-.patch \
       file://0143-tree-optimization-107254-check-and-support-live-lane.patch \
       file://0144-Fix-register-count-when-not-splitting-Complex-IEEE-1.patch \
       file://0145-Daily-bump.patch \
       file://0146-Daily-bump.patch \
       file://0147-rs6000-Fix-condition-of-define_expand-vec_shr_-mode-.patch \
       file://0148-rs6000-Fix-the-condition-with-frame_pointer_needed_i.patch \
       file://0149-Remove-undefined-behaviour-from-testscase.patch \
       file://0150-libstdc-eh_globals-gthreads-reset-_S_init-before-del.patch \
       file://0151-Daily-bump.patch \
       file://0152-aarch64-Define-__ARM_FEATURE_RCPC.patch \
       file://0153-aarch64-Fix-matching-of-BRKNS.patch \
       file://0154-aarch64-Prevent-generation-of-M-BRKAS-and-BRKBS.patch \
       file://0155-Make-c-c-common-goacc-kernels-decompose-pr100400-1-..patch \
       file://0156-Daily-bump.patch \
       file://0157-tree-optimization-107323-loop-distribution-partition.patch \
       file://0158-amdgcn-Use-FLAT-addressing-for-all-functions-with-po.patch \
       file://0159-Add-libgomp.oacc-c-c-common-private-big-1.c-PR105421.patch \
       file://0160-Daily-bump.patch \
       file://0161-Daily-bump.patch \
       file://0162-Fortran-error-recovery-with-references-of-bad-array-.patch \
       file://0163-Daily-bump.patch \
       file://0164-Daily-bump.patch \
       file://0165-x86-fix-VENDOR_MAX-enum-value.patch \
       file://0166-i386-fix-pedantic-warning.patch \
       file://0167-IBM-zSystems-Fix-function_ok_for_sibcall-PR106355.patch \
       file://0168-Relax-assertion-in-profiler.patch \
       file://0169-Daily-bump.patch \
       file://0170-aarch64-fix-off-by-one-in-reading-cpuinfo.patch \
       file://0171-aarch64-update-Ampere-1-core-definition.patch \
       file://0172-Daily-bump.patch \
       file://0173-IRA-Make-sure-array-is-big-enough.patch \
       file://0174-lto-do-not-load-LTO-stream-for-aliases-PR107418.patch \
       file://0175-Daily-bump.patch \
       file://0176-OpenACC-Don-t-gang-privatize-artificial-variables-PR.patch \
       file://0177-Fortran-BOZ-literal-constants-are-not-compatible-to-.patch \
       file://0178-Daily-bump.patch \
       file://0179-Fortran-Add-missing-TKR-initialization-to-class-vari.patch \
       file://0180-Daily-bump.patch \
       file://0181-Daily-bump.patch \
       file://0182-Daily-bump.patch \
       file://0183-Daily-bump.patch \
       file://0184-Daily-bump.patch \
       file://0185-openmp-Fix-handling-of-target-constructs-in-static-m.patch \
       file://0186-openmp-c-Tighten-up-c_tree_equal-PR106981.patch \
       file://0187-openmp-Fix-ICE-with-taskgroup-at-O0-fexceptions-PR10.patch \
       file://0188-tree-cfg-Fix-a-verification-diagnostic-typo-PR107121.patch \
       file://0189-libgomp-Fix-up-creation-of-artificial-teams.patch \
       file://0190-c-Fix-up-constexpr-handling-of-char-signed-char-shor.patch \
       file://0191-c-c-Fix-up-excess-precision-handling-of-scalar_to_ve.patch \
       file://0192-i386-Fix-uninitialized-register-after-peephole2-conv.patch \
       file://0193-Daily-bump.patch \
       file://0194-Fix-recent-thinko-in-operand_equal_p.patch \
       file://0195-doc-Document-correct-fwide-exec-charset-defaults-PR4.patch \
       file://0196-Daily-bump.patch \
       file://0197-Daily-bump.patch \
       file://0198-Remove-AVX512_VP2INTERSECT-from-PTA_SAPPHIRERAPIDS.patch \
       file://0199-Daily-bump.patch \
       file://0200-libstdc-Remove-empty-author-elements-in-manual.patch \
       file://0201-Always-use-TYPE_MODE-instead-of-DECL_MODE-for-vector.patch \
       file://0202-Daily-bump.patch \
       file://0203-Restore-RTL-alias-analysis-for-hard-frame-pointer.patch \
       file://0204-Add-guality-testcase-for-RTL-alias-analysis-fix.patch \
       file://0205-Daily-bump.patch \
       file://0206-Daily-bump.patch \
       file://0207-Daily-bump.patch \
       file://0208-Daily-bump.patch \
       file://0209-Daily-bump.patch \
       file://0210-libstdc-Set-active-union-member-in-constexpr-std-str.patch \
       file://0211-libstdc-Fix-wstring-conversions-in-filesystem-path-P.patch \
       file://0212-libstdc-Fix-std-move_only_function-for-incomplete-pa.patch \
       file://0213-Daily-bump.patch \
       file://0214-Daily-bump.patch \
       file://0215-SRA-Limit-replacement-creation-for-accesses-propagat.patch \
       file://0216-aarch64-Add-support-for-Ampere-1A-mcpu-ampere1a-CPU.patch \
       file://0217-Daily-bump.patch \
       file://0218-c-constinit-on-pointer-to-function-PR104066.patch \
       file://0219-Daily-bump.patch \
       file://0220-LoongArch-Fix-atomic_exchange-expanding-PR107713.patch \
       file://0221-nvptx-In-STARTFILE_SPEC-fix-crt0.o-for-mmainkernel.patch \
       file://0222-libatomic-Handle-AVX-CX16-AMD-like-Intel-for-16b-ato.patch \
       file://0223-c-Fix-a-typo-in-function-name.patch \
       file://0224-reg-stack-Fix-a-fcompare-debug-bug-in-reg-stack-PR10.patch \
       file://0225-Daily-bump.patch \
       file://0226-i386-Uglify-some-local-identifiers-in-intrin.h-PR107.patch \
       file://0227-Daily-bump.patch \
       file://0228-libstdc-Fix-pool-resource-build-errors-for-H8-PR1078.patch \
       file://0229-libstdc-Add-workaround-for-fs-path-constraint-recurs.patch \
       file://0230-Daily-bump.patch \
       file://0231-Daily-bump.patch \
       file://0232-libstdc-Fix-std-is_nothrow_invocable_r-for-uncopyabl.patch \
       file://0233-libstdc-Add-comparisons-to-std-default_sentinel_t-LW.patch \
       file://0234-libstdc-Add-missing-runtime-exception-to-licence-not.patch \
       file://0235-libstdc-Document-LWG-1203-API-change-in-manual.patch \
       file://0236-libstdc-Fix-dangling-reference-in-filesystem-path-fi.patch \
       file://0237-libstdc-Check-static-assertions-earlier-in-chrono-du.patch \
       file://0238-libstdc-Remove-unnecessary-variant-member-in-std-exp.patch \
       file://0239-libstdc-Fix-tests-with-non-const-operator.patch \
       file://0240-libstdc-Remove-unnecessary-header-from-memory.patch \
       file://0241-Fix-wrong-array-type-conversion-with-different-stora.patch \
       file://0242-Fix-thinko-in-operator_bitwise_xor-op1_range.patch \
       file://0243-Daily-bump.patch \
       file://0244-Fortran-reject-NULL-actual-argument-without-explicit.patch \
       file://0245-Daily-bump.patch \
       file://0246-Daily-bump.patch \
       file://0247-Daily-bump.patch \
       file://0248-Daily-bump.patch \
       file://0249-gcc-fix-PR-rtl-optimization-107482.patch \
       file://0250-Daily-bump.patch \
       file://0251-Fix-addvdi3-and-subvdi3-patterns.patch \
       file://0252-d-Fix-error-You-must-define-PREFERRED_DEBUGGING_TYPE.patch \
       file://0253-d-Fix-ICE-on-named-continue-label-in-an-unrolled-loo.patch \
       file://0254-d-Include-tm.h-in-all-D-target-platform-sources-remo.patch \
       file://0255-Daily-bump.patch \
       file://0256-Fix-unrecognizable-insn-due-to-illegal-immediate_ope.patch \
       file://0257-Daily-bump.patch \
       file://0258-Daily-bump.patch \
       file://0259-Daily-bump.patch \
       file://0260-Daily-bump.patch \
       file://0261-tree-optimization-107956-ICE-with-NULL-call-LHS.patch \
       file://0262-Daily-bump.patch \
       file://0263-aarch64-Specify-that-FEAT_MOPS-sequences-clobber-CC.patch \
       file://0264-Daily-bump.patch \
       file://0265-Daily-bump.patch \
       file://0266-Daily-bump.patch \
       file://0267-i386-simplify-cpu_feature-handling.patch \
       file://0268-i386-fix-assert-__builtin_cpu_supports-x86-64-0.patch \
       file://0269-Daily-bump.patch \
       file://0270-Daily-bump.patch \
       file://0271-d-Fix-internal-compiler-error-in-visit-at-d-imports..patch \
       file://0272-d-Remove-final-and-override-from-visitor-method.patch \
       file://0273-Daily-bump.patch \
       file://0274-tree-optimization-106868-bogus-Wdangling-pointer-dia.patch \
       file://0275-tree-optimization-107407-wrong-code-with-DSE.patch \
       file://0276-tree-optimization-107647-avoid-FMA-from-SLP-with-ffp.patch \
       file://0277-tree-optimization-107766-ICE-with-recent-ffp-contrac.patch \
       file://0278-tree-optimization-107686-fix-bitfield-ref-through-ve.patch \
       file://0279-tree-optimization-107833-invariant-motion-of-uninit-.patch \
       file://0280-tree-optimization-107865-ICE-with-outlining-of-loops.patch \
       file://0281-tree-optimization-107898-ICE-with-Walloca-larger-tha.patch \
       file://0282-d-Fix-undefined-reference-to-nested-lambda-in-templa.patch \
       file://0283-Daily-bump.patch \
       file://0284-varasm-Fix-type-confusion-bug.patch \
       file://0285-libphobos-Backport-library-and-bindings-fixes-from-m.patch \
       file://0286-Daily-bump.patch \
       file://0287-libstdc-Fix-size-passed-to-operator-delete-PR108097.patch \
       file://0288-Daily-bump.patch \
       file://0289-AArch64-Add-UNSPECV_PATCHABLE_AREA-PR98776.patch \
       file://0290-Daily-bump.patch \
       file://0291-Daily-bump.patch \
       file://0292-Daily-bump.patch \
       file://0293-Fortran-ICE-on-recursive-derived-types-with-allocata.patch \
       file://0294-Daily-bump.patch \
       file://0295-c-family-Fix-ICE-with-Wsuggest-attribute-PR98487.patch \
       file://0296-c-ICE-with-of-incompatible-pointers-PR107542.patch \
       file://0297-c-substituting-CONST_DECL_USING_P-enumerators-PR1030.patch \
       file://0298-c-pack-in-requires-expr-parm-list-PR107417.patch \
       file://0299-c-partial-ordering-with-memfn-ptr-cst-PR108104.patch \
       file://0300-c-extract_local_specs-and-unevaluated-contexts-PR100.patch \
       file://0301-Daily-bump.patch \
       file://0302-i386-Avoid-fma_chain-for-march-alderlake-and-sapphir.patch \
       file://0303-d-104749-document-host-GDC-version-requirement.patch \
       file://0304-Daily-bump.patch \
       file://0305-libgfortran-s-ISO_Fortran_binding.c-Use-GCC11-versio.patch \
       file://0306-libstdc-Fixes-for-std-expected.patch \
       file://0307-libstdc-Fix-unsafe-use-of-dirent-d_name-PR107814.patch \
       file://0308-Daily-bump.patch \
       file://0309-Factor-out-jobserver_active_p.patch \
       file://0310-lto-support-jobserver-style-fifo-for-recent-GNU-make.patch \
       file://0311-bootstrap-106482-document-minimal-GCC-version.patch \
       file://0312-Daily-bump.patch \
       file://0313-Daily-bump.patch \
       file://0314-Skip-guality-tests-on-hppa-hpux.patch \
       file://0315-Daily-bump.patch \
       file://0316-Daily-bump.patch \
       file://0317-Daily-bump.patch \
       file://0318-Daily-bump.patch \
       file://0319-Fortran-incorrect-array-bounds-when-bound-intrinsic-.patch \
       file://0320-Daily-bump.patch \
       file://0321-Daily-bump.patch \
       file://0322-Daily-bump.patch \
       file://0323-Daily-bump.patch \
       file://0324-Daily-bump.patch \
       file://0325-Daily-bump.patch \
       file://0326-Daily-bump.patch \
       file://0327-libsanitizer-Avoid-implicit-function-declaration-in-.patch \
       file://0328-libiberty-Fix-C89-isms-in-configure-tests.patch \
       file://0329-c-mark_single_function-and-SFINAE-PR108282.patch \
       file://0330-Daily-bump.patch \
       file://0331-rs6000-Raise-error-for-__vector_-quad-pair-uses-with.patch \
       file://0332-libstdc-Fix-std-chrono-hh_mm_ss-with-unsigned-rep-PR.patch \
       file://0333-Daily-bump.patch \
       file://0334-Daily-bump.patch \
       file://0335-Daily-bump.patch \
       file://0336-Daily-bump.patch \
       file://0337-Update-cpplib-eo.po.patch \
       file://0338-Daily-bump.patch \
       file://0339-aarch64-PR-target-108140-Handle-NULL-target-in-data-.patch \
       file://0340-Fix-memory-constraint-on-MVE-v-ld-st-2-4-instruction.patch \
       file://0341-Daily-bump.patch \
       file://0342-strlen-do-not-use-cond_expr-for-boundaries.patch \
       file://0343-Fix-problematic-interaction-between-bitfields-unions.patch \
       file://0344-Daily-bump.patch \
       file://0345-Daily-bump.patch \
       file://0346-Daily-bump.patch \
       file://0347-Daily-bump.patch \
       file://0348-Daily-bump.patch \
       file://0349-libstdc-Unblock-atomic-wait-on-non-futex-platforms-P.patch \
       file://0350-Add-cpplib-ka.po.patch \
       file://0351-Daily-bump.patch \
       file://0352-Daily-bump.patch \
       file://0353-libstdc-Avoid-recursion-in-__nothrow_wait_cv-wait-PR.patch \
       file://0354-Daily-bump.patch \
       file://0355-Daily-bump.patch \
       file://0356-Daily-bump.patch \
       file://0357-Backported-from-master.patch \
       file://0358-Daily-bump.patch \
       file://0359-Daily-bump.patch \
       file://0360-PR-106101-IBM-zSystems-Fix-strict_low_part-problem.patch \
       file://0361-Fortran-error-recovery-for-invalid-CLASS-component-P.patch \
       file://0362-Daily-bump.patch \
       file://0363-driver-fix-environ-corruption-after-putenv-PR106624.patch \
       file://0364-tree-optimization-107554-fix-ICE-in-stlen-optimizati.patch \
       file://0365-middle-end-107994-ICE-after-error-with-comparison-gi.patch \
       file://0366-tree-optimization-108076-if-conversion-and-forced-la.patch \
       file://0367-tree-optimization-108164-undefined-overflow-with-IV-.patch \
       file://0368-Daily-bump.patch \
       file://0369-aarch64-fix-warning-emission-for-ABI-break-since-GCC.patch \
       file://0370-Daily-bump.patch \
       file://0371-restrict-gcc.dg-pr107554.c-to-64bit-platforms.patch \
       file://0372-pru-Fix-CLZ-expansion-for-QI-and-HI-modes.patch \
       file://0373-opts-SANITIZE_ADDRESS-wrongly-cleared-PR108543.patch \
       file://0374-Daily-bump.patch \
       file://0375-arm-Fix-MVE-s-vcmp-vector-scalar-patterns-PR107987.patch \
       file://0376-Daily-bump.patch \
       file://0377-Fortran-fix-NULL-pointer-dereference-in-gfc_check_de.patch \
       file://0378-Fortran-avoid-ICE-on-invalid-array-subscript-triplet.patch \
       file://0379-Fortran-fix-ICE-in-check_charlen_present-PR108420.patch \
       file://0380-Fortran-fix-ICE-in-get_expr_storage_size-PR108421.patch \
       file://0381-Fortran-error-recovery-for-bad-initializers-of-impli.patch \
       file://0382-Fortran-ICE-in-transformational_result-PR108529.patch \
       file://0383-Enable-AMD-znver4-support-and-add-instruction-reserv.patch \
       file://0384-Remove-znver4-instruction-reservations.patch \
       file://0385-Add-AMD-znver4-instruction-reservations.patch \
       file://0386-Daily-bump.patch \
       file://0387-Update-znver4-costs.patch \
       file://0388-Zen4-tuning-part-2.patch \
       file://0389-Disable-gather-scatter-for-zen4.patch \
       file://0390-Daily-bump.patch \
       file://0391-Change-AVX512FP16-to-AVX512-FP16-in-the-document.patch \
       file://0392-OpenMP-Fortran-Fix-has_device_addr-clause-splitting-.patch \
       file://0393-Correctly-detect-shifts-out-of-range.patch \
       file://0394-Daily-bump.patch \
       file://0395-c-fix-ICE-with-Wduplicated-cond-PR107593.patch \
       file://0396-Daily-bump.patch \
       file://0397-c-ICE-with-Wlogical-op-PR107755.patch \
       file://0398-ipa-Release-body-more-carefully-when-removing-nodes-.patch \
       file://0399-Daily-bump.patch \
       file://0400-libstdc-Declare-const-global-variables-inline.patch \
       file://0401-libstdc-Fix-build-failures-for-avr.patch \
       file://0402-libstdc-Fix-std-random_device-for-avr.patch \
       file://0403-Fortran-diagnose-USE-associated-symbols-in-COMMON-bl.patch \
       file://0404-Daily-bump.patch \
       file://0405-c-unexpected-ADDR_EXPR-after-overload-set-pruning-PR.patch \
       file://0406-Daily-bump.patch \
       file://0407-Daily-bump.patch \
       file://0408-Fortran-fix-ICE-in-compare_bound_int-PR108527.patch \
       file://0409-Fortran-error-recovery-on-invalid-array-section-PR10.patch \
       file://0410-fortran-Set-name-for-LOC-default-BACK-argument-PR108.patch \
       file://0411-Daily-bump.patch \
       file://0412-c-equivalence-of-non-dependent-calls-PR107461.patch \
       file://0413-Daily-bump.patch \
       file://0414-tree-optimization-108522-Use-COMPONENT_REF-offset-wh.patch \
       file://0415-tree-optimization-108522-Use-component_ref_field_off.patch \
       file://0416-Fix-PR-108582-ICE-due-to-PHI-OPT-removing-a-still-in.patch \
       file://0417-Daily-bump.patch \
       file://0418-Fortran-ASSOCIATE-variables-should-not-be-TREE_STATI.patch \
       file://0419-Daily-bump.patch \
       file://0420-Fortran-error-handling-of-global-entity-appearing-in.patch \
       file://0421-Daily-bump.patch \
       file://0422-c-Fix-compile-time-hog-in-c_genericize-PR107127.patch \
       file://0423-testsuite-Fix-up-broken-testcase-PR107127.patch \
       file://0424-asan-Fix-up-error-recovery-for-too-large-frames-PR10.patch \
       file://0425-i386-Fix-up-ix86_abi-handling-PR106875.patch \
       file://0426-cfgbuild-Fix-DEBUG_INSN-handling-in-find_bb_boundari.patch \
       file://0427-ivopts-Fix-IP_END-handling-for-asm-goto-PR107997.patch \
       file://0428-into-ssa-Fix-emitting-debug-stmts-after-asm-goto-PR1.patch \
       file://0429-c-Ensure-var-is-not-an-lvalue-PR107065.patch \
       file://0430-loop-invariant-Split-preheader-edge-if-the-preheader.patch \
       file://0431-testsuite-Fix-up-pr64536.c-for-LLP64-targets-PR10815.patch \
       file://0432-testsuite-Fix-up-pr64536.c-for-LLP64-targets-PR10815.patch \
       file://0433-openmp-Don-t-try-to-destruct-DECL_OMP_PRIVATIZED_MEM.patch \
       file://0434-cse-Fix-up-CSE-const_anchor-handling-PR108193.patch \
       file://0435-phiopt-Drop-SSA_NAME_RANGE_INFO-in-maybe-equal-case-.patch \
       file://0436-tree-ssa-dom-can_infer_simple_equiv-fixes-PR108068.patch \
       file://0437-expr-Fix-up-store_expr-into-SUBREG_PROMOTED_-target-.patch \
       file://0438-generic-match-head-Don-t-assume-GENERIC-folding-is-d.patch \
       file://0439-c-Error-recovery-in-merge_default_template_args-PR10.patch \
       file://0440-openmp-Fix-up-finish_omp_target_clauses-PR108286.patch \
       file://0441-fortran-Fix-up-function-types-for-realloc-and-sincos.patch \
       file://0442-c-Don-t-emit-DEBUG_BEGIN_STMTs-for-K-R-function-argu.patch \
       file://0443-openmp-Fix-up-OpenMP-expansion-of-non-rectangular-lo.patch \
       file://0444-c-Fix-up-handling-of-references-to-anon-union-member.patch \
       file://0445-options-fix-cl_target_option_print_diff-with-strings.patch \
       file://0446-store-merging-Disable-string_concatenate-mode-if-sta.patch \
       file://0447-doc-Fix-up-return-type-of-__builtin_va_arg_pack_len-.patch \
       file://0448-bbpart-Fix-up-ICE-on-asm-goto-PR108596.patch \
       file://0449-i386-Fix-up-ix86_convert_const_wide_int_to_broadcast.patch \
       file://0450-c-openmp-Handle-some-OMP_-OACC_-constructs-during-co.patch \
       file://0451-ree-Fix-fcompare-debug-issues-in-combine_reaching_de.patch \
       file://0452-nested-openmp-Wrap-OMP_CLAUSE_-_GIMPLE_SEQ-into-GIMP.patch \
       file://0453-fortran-Fix-up-hash-table-usage-in-gfc_trans_use_stm.patch \
       file://0454-vect-patterns-Fix-up-vect_widened_op_tree-PR108692.patch \
       file://0455-match.pd-When-simplifying-BFR-of-an-insert-require-a.patch \
       file://0456-libstdc-Update-from-latest-fast_float-PR107468.patch \
       file://0457-libstdc-Another-merge-from-fast_float-upstream-PR107.patch \
       file://0458-c-Avoid-incorrect-shortening-of-divisions-PR108365.patch \
       file://0459-forwprop-Fix-up-rotate-pattern-matching-PR106523.patch \
       file://0460-forwprop-Further-fixes-for-simplify_rotate-PR108440.patch \
       file://0461-c-Handle-structured-bindings-like-anon-unions-in-ini.patch \
       file://0462-c-family-Honor-Wno-init-self-for-cv-qual-vars-PR1026.patch \
       file://0463-c-c-Allow-ignoring-Winit-self-through-pragmas-PR1055.patch \
       file://0464-x86-Avoid-Wuninitialized-warnings-on-_mm-_undefined_.patch \
       file://0465-i386-Fix-up-Wuninitialized-warnings-in-avx512erintri.patch \
       file://0466-Daily-bump.patch \
       file://0467-Suppress-fstack-protector-warning-on-hppa.patch \
       file://0468-Daily-bump.patch \
       file://0469-Daily-bump.patch \
       file://0470-rs6000-Teach-rs6000_opaque_type_invalid_use_p-about-.patch \
       file://0471-rs6000-Teach-rs6000_opaque_type_invalid_use_p-about-.patch \
       file://0472-rs6000-Fix-typo-on-vec_vsubcuq-in-rs6000-overload.de.patch \
       file://0473-Daily-bump.patch \
       file://0474-libstdc-Add-missing-free-functions-for-atomic_flag-P.patch \
       file://0475-Fix-small-regression-in-Ada.patch \
       file://0476-c-fix-ICE-in-joust_maybe_elide_copy-PR106675.patch \
       file://0477-Daily-bump.patch \
       file://0478-warn-access-wrong-Wdangling-pointer-with-labels-PR10.patch \
       file://0479-Fix-PR-target-90458.patch \
       file://0480-Daily-bump.patch \
       file://0481-Fortran-error-recovery-on-invalid-assumed-size-refer.patch \
       file://0482-libstdc-Ensure-__builtin_constant_p-isn-t-lost-on-th.patch \
       file://0483-libstdc-Document-timeout-and-timeout-factor-of-simd-.patch \
       file://0484-libstdc-printf-format-string-fix-in-testsuite.patch \
       file://0485-libstdc-Fix-incorrect-__builtin_is_constant_evaluate.patch \
       file://0486-libstdc-Fix-incorrect-function-call-in-ffast-math-op.patch \
       file://0487-Daily-bump.patch \
       file://0488-Daily-bump.patch \
       file://0489-LoongArch-Fix-multiarch-tuple-canonization.patch \
       file://0490-Daily-bump.patch \
       file://0491-Daily-bump.patch \
       file://0492-aarch64-Fix-up-bfmlal-lane-pattern-PR104921.patch \
       file://0493-c-ICE-with-redundant-capture-PR108829.patch \
       file://0494-Daily-bump.patch \
       file://0495-libstdc-Fix-std-filesystem-errors-with-fkeep-inline-.patch \
       file://0496-libstdc-Add-noexcept-specifier-to-std-reference_wrap.patch \
       file://0497-Daily-bump.patch \
       file://0498-Daily-bump.patch \
       file://0499-libstdc-Fix-uses-of-non-reserved-names-in-simd-heade.patch \
       file://0500-libstdc-Add-missing-constexpr-on-simd-shift-implemen.patch \
       file://0501-libstdc-Fix-Wsign-compare-issue.patch \
       file://0502-libstdc-Simplify-three-helper-functions-into-one.patch \
       file://0503-Daily-bump.patch \
       file://0504-RTEMS-Tune-multilib-selection.patch \
       file://0505-Daily-bump.patch \
       file://0506-Daily-bump.patch \
       file://0507-Daily-bump.patch \
       file://0508-rs6000-test-Adjust-some-test-cases-on-partial-vector.patch \
       file://0509-asan-adjust-module-name-for-global-variables.patch \
       file://0510-Daily-bump.patch \
       file://0511-Daily-bump.patch \
       file://0512-Daily-bump.patch \
       file://0513-Daily-bump.patch \
       file://0514-d-Fix-ICE-on-explicit-immutable-struct-import-PR1088.patch \
       file://0515-s390-libatomic-Fix-16-byte-atomic-cas-load-store.patch \
       file://0516-Daily-bump.patch \
       file://0517-c-ICE-with-constexpr-variable-template-PR107938.patch \
       file://0518-c-can-t-eval-PTRMEM_CST-in-incomplete-class-PR107574.patch \
       file://0519-c-ICE-with-Wmismatched-tags-and-member-template-PR10.patch \
       file://0520-c-family-avoid-compile-time-hog-in-c_genericize-PR10.patch \
       file://0521-c-variable-template-and-targ-deduction-PR108550.patch \
       file://0522-Fortran-improve-checking-of-character-length-specifi.patch \
       file://0523-Fortran-reject-invalid-CHARACTER-length-of-derived-t.patch \
       file://0524-Fortran-fix-corner-case-of-IBITS-intrinsic-PR108937.patch \
       file://0525-Daily-bump.patch \
       file://0526-Daily-bump.patch \
       file://0527-LoongArch-Stop-mfpu-from-silently-breaking-ABI-PR109.patch \
       file://0528-Daily-bump.patch \
       file://0529-c-requires-expr-and-access-checking-PR107179.patch \
       file://0530-c-explicit-specialization-and-trailing-requirements-.patch \
       file://0531-c-template-friend-with-variadic-constraints-PR107853.patch \
       file://0532-c-get_nsdmi-in-template-context-PR108116.patch \
       file://0533-c-thinko-in-extract_local_specs-PR108998.patch \
       file://0534-c-error-with-constexpr-operator-PR107939.patch \
       file://0535-c-ICE-initing-lifetime-extended-constexpr-var-PR1070.patch \
       file://0536-set-c-default-standard-to-c-14.patch \
       file://0537-fix-the-c-sources-building-failure-issue.patch \
       file://0538-enable-ifunc-for-riscv.patch \
       file://0539-add-b-extension-support.patch \
       file://0540-RISC-V-Handle-different-sigcontext-struct-layout.patch \
       file://0541-append-zifenci-to-workaround-rvi20-test-failure.patch \
       file://0542-add-some-zba-zbb-builtins.patch \
       file://0543-add-cost-for-shxadd-and-bswap.patch \
       file://0544-Make-ranger-vrp1-default.patch \
       file://0545-add-multilib-config-for-baremetal.patch \
       file://0546-add-dubhe-pipeline-model.patch \
       file://0547-RISCV-default-enable-align-functions-16-and-align-lo.patch \
"

SRC_URI[sha256sum] = "e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff"

S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/${SOURCEDIR}"
B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}"

# Language Overrides
FORTRAN = ""
JAVA = ""

SSP ?= "--disable-libssp"
SSP:mingw32 = "--enable-libssp"

EXTRA_OECONF_BASE = "\
    ${SSP} \
    --enable-libitm \
    --enable-lto \
    --disable-bootstrap \
    --with-system-zlib \
    ${@'--with-linker-hash-style=${LINKER_HASH_STYLE}' if '${LINKER_HASH_STYLE}' else ''} \
    --enable-linker-build-id \
    --with-ppl=no \
    --with-cloog=no \
    --enable-checking=release \
    --enable-cheaders=c_global \
    --without-isl \
"

EXTRA_OECONF_INITIAL = "\
    --disable-libgomp \
    --disable-libitm \
    --disable-libquadmath \
    --with-system-zlib \
    --disable-lto \
    --disable-plugin \
    --enable-linker-build-id \
    --enable-decimal-float=no \
    --without-isl \
    --disable-libssp \
"

EXTRA_OECONF_PATHS = "\
    --with-gxx-include-dir=/not/exist{target_includedir}/c++/${BINV} \
    --with-sysroot=/not/exist \
    --with-build-sysroot=${STAGING_DIR_TARGET} \
"

# Is a binutils 2.26 issue, not gcc
CVE_CHECK_IGNORE += "CVE-2021-37322"
