Issue 177849
Summary linker error when calling ieee_set_halting_mode from a subroutine
Labels new issue
Assignees
Reporter hassaniriad
    Dear all,
when I compile this minimal example 
```fortran
use, intrinsic :: ieee_exceptions
  call foo ( .false. )
contains
   subroutine foo ( ieee_halting )
      logical, intent(in) :: ieee_halting
      if ( ieee_support_halting(ieee_overflow) ) &
 call ieee_set_halting_mode ( ieee_overflow, halting = ieee_halting )
   end subroutine foo
end
```
I get this error : 
```
flang truc.f90
Undefined symbols for architecture arm64:
  "_fedisableexcept", referenced from:
 __QFPfoo in truc-917008.o
  "_feenableexcept", referenced from:
 __QFPfoo in truc-917008.o
  "_fegetexcept", referenced from:
 __QFPfoo in truc-917008.o
ld: symbol(s) not found for architecture arm64
flang-21: error: linker command failed with exit code 1 (use -v to see invocation)
```
```
flang --version
Homebrew flang version 21.1.8
Target: arm64-apple-darwin24.6.0
Thread model: posix
InstalledDir: /opt/homebrew/Cellar/flang/21.1.8/libexec
Configuration file: /opt/homebrew/Cellar/flang/21.1.8/libexec/flang.cfg
Configuration file: /opt/homebrew/etc/clang/arm64-apple-darwin24.cfg
```

The issue goes away if ieee_set_halting_mode is called directly from the main program : 
```
use, intrinsic :: ieee_exceptions
logical :: ieee_halting = .false.
if ( ieee_support_halting(ieee_overflow) ) &
         call ieee_set_halting_mode ( ieee_overflow, halting = ieee_halting )
end
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to