Skip to content

Conversation

luporl
Copy link
Contributor

@luporl luporl commented Sep 22, 2025

Clang on Darwin enables non-POSIX extensions by default.
This causes some macros to leak, such as HUGE from <math.h>, which
causes some conflicts with Flang symbols (but not with Flang-RT, for
now).

It also causes some Flang-RT extensions to be disabled, such as FDATE,
that checks for _POSIX_C_SOURCE. Setting _POSIX_C_SOURCE avoids these
issues. This is already being done in Flang, but it was not ported to
Flang-RT.

This also fixes check-flang-rt on Darwin, as NoArgv.FdateNotSupported
is broken since the flang runtime was moved to flang-rt.

Fixes #82036

Clang on Darwin enables non-POSIX extensions by default.
This causes some macros to leak, such as HUGE from <math.h>, which
causes some conflicts with Flang symbols (but not with Flang-RT, for
now).

It also causes some Flang-RT extensions to be disabled, such as FDATE,
that checks for _POSIX_C_SOURCE. Setting _POSIX_C_SOURCE avoids these
issues. This is already being done in Flang, but it was not ported to
Flang-RT.

This also fixes check-flang-rt on Darwin, as NoArgv.FdateNotSupported
is broken since the flang runtime was moved to flang-rt.

Fixes llvm#82036
Copy link
Member

@DavidTruby DavidTruby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@luporl luporl merged commit bb38b48 into llvm:main Sep 26, 2025
10 checks passed
@luporl luporl deleted the luporl-osx-fix-fdate branch September 26, 2025 12:37
@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 1, 2025

LLVM Buildbot has detected a new failure on builder ppc64le-flang-rhel-clang running on ppc64le-flang-rhel-test while building flang-rt at step 6 "test-build-unified-tree-check-flang".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/157/builds/40546

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-flang) failure: 1200 seconds without output running [b'ninja', b'check-flang'], attempting to kill
...
PASS: Flang :: Transforms/dlti-dependency.fir (3836 of 3846)
PASS: Flang :: Driver/use-module.f90 (3837 of 3846)
PASS: Flang :: Transforms/DoConcurrent/basic_host.f90 (3838 of 3846)
PASS: Flang :: Transforms/debug-line-table.fir (3839 of 3846)
PASS: Flang :: Transforms/debug-dwarf-version.fir (3840 of 3846)
PASS: Flang :: Semantics/numeric_storage_size.f90 (3841 of 3846)
PASS: Flang :: Driver/fopenmp.f90 (3842 of 3846)
PASS: Flang :: Transforms/tbaa-local-alloc-threshold.fir (3843 of 3846)
PASS: Flang :: Transforms/stack-arrays.f90 (3844 of 3846)
PASS: Flang :: Driver/omp-driver-offload.f90 (3845 of 3846)
command timed out: 1200 seconds without output running [b'ninja', b'check-flang'], attempting to kill
process killed by signal 9
program finished with exit code -1
elapsedTime=1819.718996

mahesh-attarde pushed a commit to mahesh-attarde/llvm-project that referenced this pull request Oct 3, 2025
Clang on Darwin enables non-POSIX extensions by default.
This causes some macros to leak, such as HUGE from <math.h>, which
causes some conflicts with Flang symbols (but not with Flang-RT, for
now).

It also causes some Flang-RT extensions to be disabled, such as FDATE,
that checks for _POSIX_C_SOURCE. Setting _POSIX_C_SOURCE avoids these
issues. This is already being done in Flang, but it was not ported to
Flang-RT.

This also fixes check-flang-rt on Darwin, as NoArgv.FdateNotSupported
is broken since the flang runtime was moved to flang-rt.

Fixes llvm#82036
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[flang] NoArgv.FdateNotSupported unit test fails on macOS

3 participants