[MacPorts] #64896: gcc and gcc-devel run fails libSystem.B.dylib not found

MacPorts noreply at macports.org
Sun Feb 12 00:35:45 UTC 2023


#64896: gcc and gcc-devel run fails libSystem.B.dylib not found
-----------------------------+--------------------
  Reporter:  AlanTAMU        |      Owner:  (none)
      Type:  defect          |     Status:  closed
  Priority:  Normal          |  Milestone:
 Component:  ports           |    Version:
Resolution:  worksforme      |   Keywords:
      Port:  ggc, gcc-devel  |
-----------------------------+--------------------

Comment (by tenomoto):

 Dynamic allocation must be the right solution but is not practical for
 existing code consisted with hundreds of files and thousands of lines
 (e.g. weather, climate, fluid dynamics, etc.). I was able to compile and
 run the simple example in #comment:5 with `-O` (also `-O2`, `-O3`,
 `-Ofast`, obviously not `-O0`), but not the weather model at hand. I need
 to use different optimization levels for some source to compile. The final
 executable still cause the same dyld error and halts. Other trials I
 failed include

 * `-fstack-arrays`, `-fno-stack-arrays`
 * All or every options implied by `-O` listed in
 https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
 * Link with Apple `/usr/bin/ld`

 {{{
 % gfortran-mp-12 foo.f90
 % ./a.out
 dyld[86786]: dyld cache '(null)' not loaded: syscall to map cache into
 shared region failed
 dyld[86786]: Library not loaded: /usr/lib/libSystem.B.dylib
 Referenced from: <1119BF13-35CB-367A-A471-14B2DF264074>
 /Users/eno/Development/stack/a.out
 Reason: tried: '/usr/lib/libSystem.B.dylib' (no such file),
 '/System/Volumes/Preboot/Cryptexes/OS/usr/lib/libSystem.B.dylib' (no such
 file), '/usr/lib/libSystem.B.dylib' (no such file, no dyld cache),
 '/usr/local/lib/libSystem.B.dylib' (no such file)
 zsh: abort      ./a.out
 % /usr/bin/ld -o a.out foo.o -lSystem -syslibroot $(xcrun -sdk macosx
 --show-sdk-path) -arch arm64 -L/opt/local/lib/gcc12 -lgfortran
 % ./a.out
 dyld[33847]: dyld cache '/System/Library/dyld/dyld_shared_cache_arm64e'
 not loaded: syscall to map cache into shared region failed
 dyld[33847]: Library not loaded: '/usr/lib/libSystem.B.dylib'
   Referenced from: '/Users/eno/Development/stack/a.out'
   Reason: tried: '/usr/lib/libSystem.B.dylib' (no such file),
 '/usr/local/lib/libSystem.B.dylib' (no such file)
 zsh: abort      ./a.out
 % gfortran-mp-12 -O foo.f90
 % ./a.out
  OK
 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/64896#comment:18>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list