Using MacPorts gcc14 (stdio.h trouble error: unknown type name 'FILE)

Gerben Wierda gerben.wierda at rna.nl
Thu Feb 13 14:17:47 UTC 2025


I see. Thanks for the info.

I thought, let’s build gcc14 from source then, but that fails.

--->  Fetching distfiles for isl
--->  Attempting to fetch isl-0.24.tar.bz2 from http://netcologne.dl.sourceforge.net/libisl
--->  Verifying checksums for isl
--->  Extracting isl
--->  Applying patches to isl
--->  Configuring isl
--->  Building isl                                       
Error: Failed to build isl: command execution failed     
Error: See /opt/local/var/macports/logs/_Users_gerben_MacPortsDev_macports-ports_devel_isl/isl/main.log for details.

I’m not getting much wiser from the log

:info:build libtool: link: /usr/bin/clang -Wall -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -arch x86_64 -Wl,-headerpad_max_install_names -Wl,-syslibroot -Wl,/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -arch x86_64 -o .libs/isl_codegen codegen.o  -L/opt/local/lib ./.libs/libisl.dylib -lgmp
:info:build make[2]: Leaving directory `/opt/local/var/macports/build/_Users_gerben_MacPortsDev_macports-ports_devel_isl/isl/work/isl-0.24'
:info:build make[1]: *** [all-recursive] Error 1
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_Users_gerben_MacPortsDev_macports-ports_devel_isl/isl/work/isl-0.24'
:info:build make: *** [all] Error 2
:info:build make: Leaving directory `/opt/local/var/macports/build/_Users_gerben_MacPortsDev_macports-ports_devel_isl/isl/work/isl-0.24'
:info:build Command failed:  cd "/opt/local/var/macports/build/_Users_gerben_MacPortsDev_macports-ports_devel_isl/isl/work/isl-0.24" && /usr/bin/make -j8 -w all 
:info:build Exit code: 2
:error:build Failed to build isl: command execution failed
:debug:build Error code: CHILDSTATUS 22283 2
:debug:build Backtrace: command execution failed
:debug:build     while executing
:debug:build "system {*}$notty {*}$callback {*}$nice $fullcmdstring"
:debug:build     invoked from within
:debug:build "command_exec -callback portprogress::target_progress_callback build"


Hmm. I’ve seen this before on a port. When downloading a binary, it works. But trying to compile yourself fails. I’ve started to suspect that MacPorts is not a very certain route when compiling yourself is part of the mix.

Anyway, building with MacPorts from source seems to use /Library/Developer/CommandLineTools/SDKs and not /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/ Developer/SDKs, and there I can find de 14.x SDK.so I might try the compiled version with that -isysroot

G

> On 13 Feb 2025, at 12:46, Chris Jones via macports-users <macports-users at lists.macports.org> wrote:
> 
> Hi,
> 
> Looks like its this
> 
> https://github.com/iains/gcc-14-branch/issues/7
> 
> Basically, GCC is sensitive to the SDK it was built against. Looks like you are likely using the binary install of gcc14 on macOS14, which would have been built using the macOS14 SDK, but you are giving it the macOS15 SDK. This is known to have problems, see the above.
> 
> You need to match SDKs. So either build GKlib using macOS14 SDK, or rebuild locally your gcc14 port against macOS15 SDK.
> 
> Or just use clang, which is anyway the defacto default C(C++) compiler on macOS.
> 
> Chris
> 
> 
> On 12/02/2025 9:46 pm, Gerben Wierda wrote:
>> I am trying to compile a library (GKlib) with MacPorts gcc14 on Sonoma 14.7,3. MacPorts is up to date
>> I have set thing sup with
>> git clone https://github.com/KarypisLab/GKlib.git <https://github.com/ KarypisLab/GKlib.git>
>> cd GKlib
>> make config cc=gcc-mp-14 prefix=../GKlibInstall
>> make
>> /opt/local/bin/gcc-mp-14  -I/Users/gerben/RenskeDev/Leon/fromsource/ GKlib/. -I/Users/gerben/RenskeDev/Leon/fromsource/GKlib/test -DLINUX - D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -march=native -fPIC -Werror -Wall -pedantic -Wno-unused-function -Wno-unused-but-set- variable -Wno-unused-variable -Wno-unknown-pragmas -Wno-unused-label - DNDEBUG -DNDEBUG2 -DHAVE_EXECINFO_H -DHAVE_GETLINE -O3 -isysroot / Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/ Developer/SDKs/MacOSX15.2.sdk -mmacosx-version-min=14.7 -MD -MT CMakeFiles/GKlib.dir/b64.c.o -MF CMakeFiles/GKlib.dir/b64.c.o.d -o CMakeFiles/GKlib.dir/b64.c.o -c /Users/gerben/RenskeDev/Leon/fromsource/ GKlib/b64.c
>> In file included from */Users/gerben/RenskeDev/Leon/fromsource/GKlib/ GKlib.h:32*,
>>                  from */Users/gerben/RenskeDev/Leon/fromsource/GKlib/ b64.c:20*:
>> */opt/local/lib/gcc14/gcc/x86_64-apple-darwin23/14.2.0/include-fixed/ stdio.h:83:8:* *error: *unknown type name '*FILE*'
>>    83 | extern *FILE**__stdinp;
>>       | *^~~~*
>> *
>> *
>> A test file in the directory above compiles fine. I’ve seen messages with this kind of trouble but I don’t understand exactly where this is going wrong.
>> */opt/local/lib/gcc14/gcc/x86_64-apple-darwin23/14.2.0/include-fixed/ stdio.h* starts with:
>> #ifndef _STDIO_H_
>> #define _STDIO_H_
>> #include <_stdio.h>
>> #include <sys/_types/_seek_set.h>
>> __BEGIN_DECLS
>> extern FILE *__stdinp;
>> When testing with the test file, the culprit seems to be
>>  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/ MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk
>> It’s been far too long I have been doing stuff like this, so I could use tips.
>> Thanks,
>> G
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20250213/a1b6f58c/attachment.htm>


More information about the macports-users mailing list