Open sanderjo opened 2 months ago
Thank you for the report. It seems that aarch64-w64-mingw32-gcc
cannot find cc1
in the PATH
. This should not happen so we will try to reproduce and investigate the issue. For now, adding ./libexec/gcc/aarch64-w64-mingw32/15.0.0
to PATH
should help.
Thanks for the quick answer.
ll ~/cross-aarch64-w64-mingw32-msvcrt/libexec/gcc/aarch64-w64-mingw32/15.0.0/
export PATH="~/cross-aarch64-w64-mingw32-msvcrt/libexec/gcc/aarch64-w64-mingw32/15.0.0/:$PATH"
sander@brixit:~/cross-aarch64-w64-mingw32-msvcrt$ printenv PATH
~/cross-aarch64-w64-mingw32-msvcrt/libexec/gcc/aarch64-w64-mingw32/15.0.0/:~/cross-aarch64-w64-mingw32-msvcrt/bin:/home/sander/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
Looks good?
But still
sander@brixit:~/cross-aarch64-w64-mingw32-msvcrt$ aarch64-w64-mingw32-gcc ../hello.c
aarch64-w64-mingw32-gcc: fatal error: cannot execute ‘cc1’: posix_spawnp: No such file or directory
compilation terminated.
The strange thing: cc1 is found ... altough I'm not sure this is aarch64-w64 one ...
sander@brixit:~/cross-aarch64-w64-mingw32-msvcrt$ cc1 --help | head
The following options are specific to just the language Ada:
-fdump-scos [available in Ada]
The following options are specific to just the language AdaSCIL:
None found. Use --help=AdaSCIL to show *all* the options supported by the AdaSCIL front-end.
The following options are specific to just the language AdaWhy:
None found. Use --help=AdaWhy to show *all* the options supported by the AdaWhy front-end.
The following options are specific to just the language C:
And which produces no output?
sander@brixit:~/cross-aarch64-w64-mingw32-msvcrt$ which cc1
sander@brixit:~/cross-aarch64-w64-mingw32-msvcrt$
I read -B could help, but
sander@brixit:~/cross-aarch64-w64-mingw32-msvcrt$ aarch64-w64-mingw32-gcc -B ~/cross-aarch64-w64-mingw32-msvcrt/libexec/gcc/aarch64-w64-mingw32/15.0.0/ ../hello.c
../hello.c:1:19: error: no include path in which to search for stdio.h
1 | #include <stdio.h>
| ^
../hello.c: In function 'main':
../hello.c:4:4: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
4 | printf("Hello, World!");
| ^~~~~~
../hello.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
+++ |+#include <stdio.h>
1 | #include <stdio.h>
../hello.c:4:4: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
4 | printf("Hello, World!");
| ^~~~~~
../hello.c:4:4: note: include '<stdio.h>' or provide a declaration of 'printf'
Hmm, interesting. It seems that builtin compiler options do not work. Don't know why yet but the other error could be fixed with -I/home/sander/cross-aarch64-w64-mingw32-msvcrt/include
.
What is your host operating system / UNIX environment?
Is this how -I should be used?
sander@brixit:~/cross-aarch64-w64-mingw32-msvcrt$ aarch64-w64-mingw32-gcc -B ~/cross-aarch64-w64-mingw32-msvcrt/libexec/gcc/aarch64-w64-mingw32/15.0.0/ -I /home/sander/cross-aarch64-w64-mingw32-msvcrt/include ../hello.c
../hello.c:1:10: fatal error: stdio.h: No such file or directory
1 | #include <stdio.h>
| ^~~~~~~~~
compilation terminated.
Plain Ubuntu 22.04
sander@brixit:~/cross-aarch64-w64-mingw32-msvcrt$
sander@brixit:~/cross-aarch64-w64-mingw32-msvcrt$ uname -a
Linux brixit 6.5.0-28-generic #29~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Apr 4 14:39:20 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
sander@brixit:~/cross-aarch64-w64-mingw32-msvcrt$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.5 LTS
Release: 22.04
Codename: jammy
is it the same issue if it is called this way?
~/cross-aarch64-w64-mingw32-msvcrt/aarch64-w64-mingw32-gcc ../hello.c
So ... hard-specifying the location inside the bin directory? With a bit different pathes ... that works:
sander@brixit:~$ ~/cross-aarch64-w64-mingw32-msvcrt/bin/aarch64-w64-mingw32-gcc ./hello.c -o hello_1234
sander@brixit:~$
sander@brixit:~$ file hello_1234
hello_1234: PE32+ executable (console) Aarch64, for MS Windows
and also
sander@brixit:~/cross-aarch64-w64-mingw32-msvcrt/bin$ ./aarch64-w64-mingw32-gcc ~/hello.c -o hello_2222
sander@brixit:~/cross-aarch64-w64-mingw32-msvcrt/bin$ file hello_2222
hello_2222: PE32+ executable (console) Aarch64, for MS Windows
It looks it can be reproduced on our side. Thanks for reporting this.
the build.sh went well, PATH is set, but I get:
cc1 is there in subdirs:
So what now?