From: Mini Administrator <macdmg@mail.com>
To: gcc-help@gcc.gnu.org
Subject: gfortran problems on M1 Mac
Date: Tue, 28 Sep 2021 10:34:36 +0200 [thread overview]
Message-ID: <2A204923-E0D1-4F6D-AEDD-1908B033557C@mail.com> (raw)
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
reply other threads:[~2021-09-28 8:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2A204923-E0D1-4F6D-AEDD-1908B033557C@mail.com \
--to=macdmg@mail.com \
--cc=gcc-help@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).