# This file created by conda-build 25.1.2
# ------------------------------------------------

package:
  name: gcc_impl_linux-64
  version: 14.3.0
source:
  - patches:
      - patches/0001-allow-commands-in-main-specfile.patch
      - patches/0002-patch-zoneinfo_dir_override-to-point-to-our-tzdata.patch
      - patches/0003-add-ldl-to-libstdc___la_LDFLAGS.patch
      - patches/0004-Hardcode-HAVE_ALIGNED_ALLOC-1-in-libstdc-v3-configur.patch
    sha256: ace8b8b0dbfe6abfc22f821cb093e195aa5498b7ccf7cd23e4424b9f14afed22
    url:
      - https://ftp.gnu.org/gnu/gcc/gcc-14.3.0/gcc-14.3.0.tar.gz
      - https://mirrors.ocf.berkeley.edu/gnu/gcc/gcc-14.3.0/gcc-14.3.0.tar.gz
build:
  detect_binary_files_with_prefix: false
  ignore_run_exports_from:
    - sysroot_linux-64
  missing_dso_whitelist:
    - '*'
  number: 4
  string: h4943218_4
requirements:
  host:
    - kernel-headers_linux-64 4.18.0 h528b178_0
    - libgcc 14.3.0 h69a1729_4
    - libgfortran5 >=14.3.0,<15.0a0
    - libgomp 14.3.0 h4751f2c_4
    - libsanitizer 14.3.0 hd4faa28_4
    - libstdcxx 14.3.0 h39759b7_4
    - sysroot_linux-64 2.28 h528b178_0
    - tzdata 2025b h04d1e81_0
  run:
    - binutils_impl_linux-64 >=2.44
    - libgcc >=14.3.0
    - libgcc-devel_linux-64 14.3.0 he7458c1_104
    - libgomp >=14.3.0
    - libsanitizer 14.3.0 hd4faa28_4
    - libstdcxx >=14.3.0
    - sysroot_linux-64
test:
  commands:
    - echo sysroot
    - echo 2.28
    - test -f ${PREFIX}/x86_64-conda-linux-gnu/lib/libgomp.so
    - test `readlink ${PREFIX}/x86_64-conda-linux-gnu/lib/libgomp.so` == "../../lib/libgomp.so"
    - test -f ${PREFIX}/bin/x86_64-conda-linux-gnu-gcc
    - test -f ${PREFIX}/bin/x86_64-conda-linux-gnu-cpp
    - test ! -f ${PREFIX}/bin/gcc
    - test ! -f ${PREFIX}/bin/cpp
    - CC=$(${PREFIX}/bin/*-gcc -dumpmachine)-gcc
    - ${CC} -Wall tests/aligned_alloc.c -c -o c_aligned.o -v -Wl,-v -march=native
    - ${CC} -Wall tests/aligned_alloc.c -c -o c_aligned.o -v -fsanitize=address
    - ${CC} -Wall tests/aligned_alloc.c -c -o c_aligned.o -v
    - ${CC} -Wall c_aligned.o -o c_aligned -v && ./c_aligned
    - ${CC} -Wall c_aligned.o -o c_aligned -Wl,-rpath,/foo && x86_64-conda-linux-gnu-readelf
      -d c_aligned | grep RPATH | grep "/foo:${PREFIX}/lib"
    - ${CC} -Wall tests/hello_world.c -c -o hello_world.o -v
    - ${CC} -Wall hello_world.o -o hello_world -v
    - test -f ${PREFIX}/x86_64-conda-linux-gnu/lib/libgcc_s.so
    - test -f ${PREFIX}/x86_64-conda-linux-gnu/lib/libsanitizer.spec
    - test -f ${PREFIX}/x86_64-conda-linux-gnu/lib/libasan_preinit.o
    - test -f ${PREFIX}/x86_64-conda-linux-gnu/lib/libgomp.spec
  files:
    - tests
  requires:
    - sysroot_linux-64 2.28.*
about:
  home: https://gcc.gnu.org/
  license: GPL-3.0-only WITH GCC-exception-3.1
  summary: GNU C Compiler
extra:
  copy_test_source_files: true
  feedstock-name: ctng-compilers-feedstock
  final: true
  recipe-maintainers:
    - beckermr
    - isuruf
    - timsnyder
    - xhochy
