Opened 3 years ago

Closed 3 years ago

#61513 closed defect (fixed)

gcc10 @10.2.0 gfortran-mp-10 ld warnings: dylib .. built for newer macOS version (11.0) than being linked (10.16)

Reported by: pmaxted (Pierre Maxted) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: bigsur Cc: cjones051073 (Chris Jones), michaelld (Michael Dickens)
Port: gcc10

Description

These warnings printed when compiling simple fortran programs, e.g., a 3-line "hello world" program ...

ld: warning: dylib (/opt/local/lib/gcc10/libgfortran.dylib) was built for newer macOS version (11.0) than being linked (10.16)
ld: warning: dylib (/opt/local/lib/gcc10/libquadmath.dylib) was built for newer macOS version (11.0) than being linked (10.16)

I recently updated to Big Sur (macos x 11.0.1).

I deleted and re-installed macports.

I have upgraded xcode to 12.2 and accepted the license.

I installed gcc10 with +gfortran.

The compiled code seems to run ok (not tested extensively).

Output of the compilation with the -v flag attached.

Attachments (1)

compile.log (5.9 KB) - added by pmaxted (Pierre Maxted) 3 years ago.
Output from "/opt/local/bin/gfortran-mp-10 -v simple.f -o simple"

Download all attachments as: .zip

Change History (13)

Changed 3 years ago by pmaxted (Pierre Maxted)

Attachment: compile.log added

Output from "/opt/local/bin/gfortran-mp-10 -v simple.f -o simple"

comment:1 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: bigsur added; big sur removed

comment:2 Changed 3 years ago by cjones051073 (Chris Jones)

Are you doing anything to explicitly force the use of 10.16 as the deployment target ?

comment:3 Changed 3 years ago by cjones051073 (Chris Jones)

Cc: cjones051073 added

comment:4 Changed 3 years ago by kencu (Ken)

Very interesting. gcc was just updated with a new upstream patch for OS "X" 11.0 -- are you using the newest patch, or the previous one?

If the previous patch, please bump up to the newer one and recheck.

comment:5 Changed 3 years ago by michaelld (Michael Dickens)

FYI gcc10 builds and works for me on macOS 11.0.1 20B29 / Xcode 12.2 12B5035g . I'm guessing as @kencu notes that you need to update your ports to get the latest patches. These are just a few days old.

comment:6 in reply to:  4 Changed 3 years ago by pmaxted (Pierre Maxted)

Replying to kencu:

Very interesting. gcc was just updated with a new upstream patch for OS "X" 11.0 -- are you using the newest patch, or the previous one?

If the previous patch, please bump up to the newer one and recheck.

You will have to explain to me how to do that - I have little experience of macports. Regards,

-Pierre

comment:7 in reply to:  2 ; Changed 3 years ago by pmaxted (Pierre Maxted)

Replying to cjones051073:

Are you doing anything to explicitly force the use of 10.16 as the deployment target ?

Not deliberately - I don't have much experience with macports so I am not doing anything complicated.

The only complication I had when installing gcc was that I tried to install gcc9, but that failed, so I installed gcc10 instead,

Regards,

-Pierre

comment:8 Changed 3 years ago by michaelld (Michael Dickens)

sudo port sync

or

sudo port selfupdate

then

sudo port clean libgcc10 libgcc gcc10
sudo port install gcc10

comment:9 in reply to:  7 Changed 3 years ago by cjones051073 (Chris Jones)

Replying to pmaxted:

Replying to cjones051073:

Are you doing anything to explicitly force the use of 10.16 as the deployment target ?

Not deliberately - I don't have much experience with macports so I am not doing anything complicated.

The only complication I had when installing gcc was that I tried to install gcc9, but that failed, so I installed gcc10 instead,

Regards,

-Pierre

I cannot reproduce what you see. Running

 > gfortran-mp-10 -v ./test.f90

does not generate any of the warnings you quote.

Specifically I see

Driving: gfortran-mp-10 -v ./test.f90 --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -mmacosx-version-min=11.0.0 -asm_macosx_version_min=11.0 -l gfortran -shared-libgcc
<snip>
/opt/local/bin/ld -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/ -dynamic -arch x86_64 -macosx_version_min 11.0.0 -weak_reference_mismatches non-weak -o a.out -L/opt/local/lib/gcc10/gcc/x86_64-apple-darwin20/10.2.0 -L/opt/local/lib/gcc10/gcc/x86_64-apple-darwin20/10.2.0/../../.. /var/folders/97/z7_b52957j36mhz075gflttr0000gn/T//ccyJcgHY.o -lgfortran -lSystem -lgcc_ext.10.5 -lgcc -lquadmath -lm -lgcc_ext.10.5 -lgcc -lSystem -no_compact_unwind -v

note 11.0.0 is set as the minimum macOSX version there, which is what I would expect as it should be the default.

You on the other hand have

[macpflm2:~] pflm% /opt/local/bin/gfortran-mp-10 -v simple.f -o simple
2	Driving: /opt/local/bin/gfortran-mp-10 -v simple.f -o simple -mmacosx-version-min=10.16.0 -asm_macosx_version_min=10.16 -l gfortran -shared-libgcc
<snip>
/opt/local/bin/ld -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk/ -dynamic -arch x86_64 -macosx_version_min 10.16.0 -weak_reference_mismatches non-weak -o simple -L/opt/local/lib/gcc10/gcc/x86_64-apple-darwin20/10.2.0 -L/opt/local/lib/gcc10/gcc/x86_64-apple-darwin20/10.2.0/../../.. /var/folders/dl/tc85r2_j2v94kqhby3hvz4n00000gn/T//ccazhqmk.o -lgfortran -lSystem -lgcc_ext.10.5 -lgcc -lquadmath -lm -lgcc_ext.10.5 -lgcc -lSystem -no_compact_unwind -v

So I am afraid but there has to be something specific to your environment that is forcing 10.16 to be the deployment target.

Last edited 3 years ago by cjones051073 (Chris Jones) (previous) (diff)

comment:10 Changed 3 years ago by michaelld (Michael Dickens)

Cc: michaelld added

comment:11 Changed 3 years ago by pmaxted (Pierre Maxted)

Fixed!

$ sudo port selfupdate

$ sudo port upgrade outdated
...
Error: gcc10 cannot be built while libunwind-headers is active.

$ sudo port clean libgcc10 libgcc gcc10
...
Error: gcc10 cannot be built while libunwind-headers is active.

$ sudo port -f deactivate libunwind-headers

$ sudo port install gcc10


comment:12 Changed 3 years ago by cjones051073 (Chris Jones)

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.