gfortran problems on M1 Mac

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I’ve installed gcc11 on a M1 Mac Mini using MacPorts (MacOS 11.6, and compiled our suite of fortran programs with no issues. All of them excecute properly but one. When run, this error occurs:

dyld: Library not loaded: /usr/lib/libSystem.B.dylib
  Referenced from: /Volumes/xHD/DMG/Shared/bin/11/pavlov7.out
  Reason: image not found
[1]    14157 abort      pavlov7.out

If I check the libraries required by the program, I get the following

otool -L /Volumes/xHD/DMG/Shared/bin/11/pavlov7.out

/Volumes/xHD/DMG/Shared/bin/11/pavlov7.out:
	@rpath/libgfortran.5.dylib (compatibility version 6.0.0, current version 6.0.0)
	@rpath/libgcc_s.1.1.dylib (compatibility version 1.0.0, current version 1.1.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.100.5)

but /usr/lib does not contain libSystem. There is a description of the issue here

<https://developer.apple.com/forums/thread/655588?answerId=665804022#665804022> 

and actually on the Mini I can find
 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libSystem.B.tbd

which is a text file containing references to

reexported-libraries:
  - targets:         [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
                       arm64e-macos, arm64e-maccatalyst ]
    libraries:       [ '/usr/lib/system/libcache.dylib', '/usr/lib/system/libcommonCrypto.dylib',
                       '/usr/lib/system/libcompiler_rt.dylib', '/usr/lib/system/libcopyfile.dylib',
                       '/usr/lib/system/libcorecrypto.dylib', '/usr/lib/system/libdispatch.dylib',
                       '/usr/lib/system/libdyld.dylib', '/usr/lib/system/libkeymgr.dylib',
                       '/usr/lib/system/liblaunch.dylib', '/usr/lib/system/libmacho.dylib',
                       '/usr/lib/system/libquarantine.dylib', '/usr/lib/system/libremovefile.dylib',
                       '/usr/lib/system/libsystem_asl.dylib', '/usr/lib/system/libsystem_blocks.dylib',
                       '/usr/lib/system/libsystem_c.dylib', '/usr/lib/system/libsystem_collections.dylib',
                       '/usr/lib/system/libsystem_configuration.dylib', '/usr/lib/system/libsystem_containermanager.dylib',
                       '/usr/lib/system/libsystem_coreservices.dylib', '/usr/lib/system/libsystem_darwin.dylib',
                       '/usr/lib/system/libsystem_dnssd.dylib', '/usr/lib/system/libsystem_featureflags.dylib',
                       '/usr/lib/system/libsystem_info.dylib', '/usr/lib/system/libsystem_kernel.dylib',
                       '/usr/lib/system/libsystem_m.dylib', '/usr/lib/system/libsystem_malloc.dylib',
                       '/usr/lib/system/libsystem_networkextension.dylib', '/usr/lib/system/libsystem_notify.dylib',
                       '/usr/lib/system/libsystem_platform.dylib', '/usr/lib/system/libsystem_product_info_filter.dylib',
                       '/usr/lib/system/libsystem_pthread.dylib', '/usr/lib/system/libsystem_sandbox.dylib',
                       '/usr/lib/system/libsystem_secinit.dylib', '/usr/lib/system/libsystem_symptoms.dylib',
                       '/usr/lib/system/libsystem_trace.dylib', '/usr/lib/system/libunwind.dylib',
                       '/usr/lib/system/libxpc.dylib' ]

I've checked with otool other executables compiled with gfortran, and they all contain

	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.100.5)

but apparently they don’t need it at runtime, so they execute properly. I suspect the one program failing may require that library due to high memory allocation needs, so I tried to recompile that program with option -mcmodel=large, but compilation fails with hundreds of errors like these


/var/folders/5m/npwgg_r174ncqgz7j9w3x_l00000gn/T//ccWZX2yC.s:11:15: error: invalid variant 'BLEAH'
        adrp    x0, lC0@BLEAH
                        ^
/var/folders/5m/npwgg_r174ncqgz7j9w3x_l00000gn/T//ccWZX2yC.s:18:15: error: invalid variant 'BLEAH'
        adrp    x2, lC1@BLEAH

which I can’t relate to any statement of the program. 

So I’ve two questions:

1) is there a solution for missing /usr/lib/libSystem.B.dylib?

2) why -mcmodel=large fails on this Mini (it works on a Linux box, but it fails on another Mac with Intel CPU with similar error but PLTOFF is mentioned instead of BLEAH)

Thanks

Franco






[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux