-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tools not compiling #774
Comments
Hello @Mellvik, I'm on macOS Mohave 10.14.6 and the tools build works for me. I'm running gcc (Apple LLVM) 9.0.0 (clang-900.0.38). We'll see what @tkchia has to say. |
Looking at elks/cross/build/gcc-src/gmp/configure, I can see several places where "rm -f conftest*" or similar are used, which could be an issue for you if your system failed some of the configure tests, and the rm was executed. You may want to try editing that file, search for "conftest" and replace the number of "rm -f ..." with "rm -rf ..." for the conftest* and conftest.* used since .dSYMs are directories on macOS. Then restart the build. I'm not quite sure how to restart the build using make instead of tools/build.sh, but I think something like "make -C tools all" will do it. |
Hello @Mellvik, hello @ghaerr, Very interesting --- and weird --- error. It seems that this happens not when building GCC proper, but when building the GNU MP library (which GCC depends on). I am not sure the If the build still does not work, consider checking Thank you! |
Thanks,
I’m looking at the configure script right now, Funny thing is that in every failure (there are just a few), the file that cannot be removed, which is actually a directory, has the extension dSYM.
Changing all rm’s (wow, there are many, including the $rm macro) changes things but does not fix them.
The log file tells me little, but may still be helpful
Test compile: __builtin_alloca availability
configure:4831: gcc -g -O2 -DNO_ASM conftest.c >&5
conftest.c:1:43: warning: non-void function does not return a value [-Wreturn-type]
int k; int foo () { __builtin_alloca (k); }
^
1 warning generated.
Undefined symbols for architecture x86_64:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure:4834: $? = 1
failed program was:
int k; int foo () { __builtin_alloca (k); }
there may be other errors, I’ll have to look at that in the morning.
—mellvik
… 6. okt. 2020 kl. 20:26 skrev tkchia ***@***.***>:
Hello @Mellvik <https://github.com/Mellvik>, hello @ghaerr <https://github.com/ghaerr>,
Very interesting --- and weird --- error.
It seems that this happens not when building GCC proper, but when building the GNU MP library (which GCC depends on).
I am not sure the rm was causing the build to fail, since you mentioned that there were several similar such rm messages just before the failure.
If the build still does not work, consider checking cross/build/gcc-build/gmp/config.log, which should give detailed logs from the configure run. This should show more clearly what was leading to the "Specified CC_FOR_BUILD doesn't seem to work" message.
Thank you!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#774 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AA3WGOBCOX4FTX7GUOYKMQTSJNOPBANCNFSM4SGKABFA>.
|
Look at the failing line in your compile - is it an "rm -rf conftest* ..."? If the -r option isn't there, then you missed one. I'm thinking the problem IS in the removal of the .dSYMS file on macOS, because I've had this very problem on other projects on macOS.
The test(s) you mention will have failures - you're just observing the method configure uses to determine whether a system has thus-and-such a capability: it compiles up code and checks the linker return value. So these are not actually errors that stop the configure script. If still in doubt, send over the patched configure file. |
Try this configure script in the gmp directory. It replaces all "rm -f conftest*" with "rm -rf conftest*". |
Hello @Mellvik,
Try looking further down the log. There should be log entries for the particular check that caused the failure, i.e. " |
Thanks @ghaerr,
I tried that one too - and got almost the same results.
The difference being that my edited version took everything ‘rm’, regardless of the file/dir-name. Slightly different error messages, same result.
It turns out there are many different file names, the common denominator not being ‘conftest’ but the .dSYM extension.
Now, even in the case where every single rm (and rm macro) in configure has been changed to rm -rf, there is still a rm-problem, supposedly indicating that there is more to it than the configure file.
Will keep you posted.
…-M
6. okt. 2020 kl. 23:27 skrev Gregory Haerr ***@***.***>:
Try this configure script in the gmp directory. It replaces all "rm -f conftest*" with "rm -rf conftest*".
configure.zip <https://github.com/jbruchon/elks/files/5336887/configure.zip>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#774 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AA3WGOEDIYKP577CLQUUSFTSJODV3ANCNFSM4SGKABFA>.
|
Hello @Mellvik, What does |
Hi @tkchia,
thanks for following up.
you may be on to something here, excerpt below. Seems non-existent include file ac_nonexistent.h is creating some havoc in the configuration process.
—M
...
configure:8322: checking how to run the C preprocessor
configure:8362: gcc -E conftest.c
configure:8368: $? = 0
configure:8399: gcc -E conftest.c
conftest.c:12:10: fatal error: 'ac_nonexistent.h' file not found
#include <ac_nonexistent.h>
^~~~~~~~~~~~~~~~~~
1 error generated.
configure:8405: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "GNU MP"
| #define PACKAGE_TARNAME "gmp"
| #define PACKAGE_VERSION "4.3.2"
| #define PACKAGE_STRING "GNU MP 4.3.2"
| #define PACKAGE_BUGREPORT "gmp-bugs@gmplib.org"
| #define PACKAGE "gmp"
| #define VERSION "4.3.2"
| #define WANT_FFT 1
| #define HAVE_HOST_CPU_none 1
| /* end confdefs.h. */
| #include <ac_nonexistent.h>
configure:8438: result: gcc -E
configure:8467: gcc -E conftest.c
configure:8473: $? = 0
configure:8504: gcc -E conftest.c
conftest.c:12:10: fatal error: 'ac_nonexistent.h' file not found
#include <ac_nonexistent.h>
^~~~~~~~~~~~~~~~~~
1 error generated.
configure:8510: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "GNU MP"
| #define PACKAGE_TARNAME "gmp"
| #define PACKAGE_VERSION "4.3.2"
| #define PACKAGE_STRING "GNU MP 4.3.2"
| #define PACKAGE_BUGREPORT "gmp-bugs@gmplib.org"
| #define PACKAGE "gmp"
| #define VERSION "4.3.2"
| #define WANT_FFT 1
| #define HAVE_HOST_CPU_none 1
| /* end confdefs.h. */
| #include <ac_nonexistent.h>
configure:8584: gcc -c -g -O2 conftest.c >&5
configure:8590: $? = 0
configure:8613: checking build system compiler gcc
configure:8626: gcc conftest.c
conftest.c:4:3: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
exit(0);
^
conftest.c:4:3: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit'
1 error generated.
configure:8629: $? = 1
configure:8636: result: no
configure:8641: error: Specified CC_FOR_BUILD doesn't seem to work
## ---------------- ##
## Cache variables. ##
… 7. okt. 2020 kl. 12:42 skrev tkchia ***@***.***>:
Hello @Mellvik <https://github.com/Mellvik>,
What does cross/build/gcc-build/gmp/config.log say about the "checking build system compiler gcc" test specifically? Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#774 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AA3WGOHEK2N35HGBMK2LBLLSJRAXZANCNFSM4SGKABFA>.
|
Hello @Mellvik, Thanks! That is very useful information. I just checked out the Apparently
The C compiler does not like this because
I.e. the test program called (I get a similar message on my system, but it was only a warning.) I guess this can be considered a bit of a bug in the GNU MP 4.3.2 configuration script...? Maybe I will check if newer versions of GNU MP have addressed this. Thank you! |
Thank you @tkchia,
again much appreciated.
Here’s some potentially useful info:
I moved the tool chain building to my laptop, where it compiles fine. There are plenty complaints about not being able to remove the dSYM directories, so that does not seem to be the problem.
What’s different between the two is the gcc version. The laptop has an older version than the iMAC:
HS-MB-Pro:elks helge$ gcc -v
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.3 (clang-1103.0.32.62)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
➜ elks git:(ethtest) ✗ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.2)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Does this provide any clues?
—Mellvik
… 7. okt. 2020 kl. 13:09 skrev tkchia ***@***.***>:
Hello @Mellvik <https://github.com/Mellvik>,
Thanks! That is very useful information.
I just checked out the configure script at around line 8,613. The log is a bit confusing --- the <ac_nonexistent.h> thing applies to the _preceding_test ("checking how to run the C preprocessor").
Apparently configure then later tries to compile a different program, which is not shown in the log (argh!). The program is simply this:
int
main ()
{
exit(0);
}
The C compiler does not like this because
conftest.c:4:3: error: implicitly declaring library function 'exit'
with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
exit(0);
^
conftest.c:4:3: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit'
I.e. the test program called exit(0); without declaring a prototype for exit(.). For some reason -Werror was turned on in your system, so that things that GCC would normally only warn about are now treated as fatal errors.
(I get a similar message on my system, but it was only a warning.)
I guess this can be considered a bit of a bug in the GNU MP 4.3.2...? Maybe I will check if newer versions of GNU MP have addressed this.
Thank you!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#774 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AA3WGOCUQOXVC4ARGT4GPETSJRD6HANCNFSM4SGKABFA>.
|
Hello @Mellvik,
Thanks. It seems that the newer LLVM-GCC compiler is (for some reason) becoming more strict when deciding which C programs it would accept, while the very old version of GNU MP happens to play a bit fast and loose with the C language, as I have explained.
I see that GNU MP 6.1.2 --- which I have been using for
(which avoids the missing prototype problem), instead of
I can think of a few ways to solve the build failure, each with its trade-offs:
Thank you! |
Hello @Mellvik, In the meantime, try modifying GMP's
with
This should hopefully improve things on your desktop iMac. Thank you! |
Thanks @tkchia -
I’m probably messing up, I couldn’t get that to work. If there is anything I can submit or test to further help the diagnosing, let me know.
I transferred the entire cross directory from the MB Pro to the iMac, and I have something that works for now.
—Mellvik
… 7. okt. 2020 kl. 15:28 skrev tkchia ***@***.***>:
Hello @Mellvik <https://github.com/Mellvik>,
In the meantime, try modifying GMP's configure script to replace all
exit(0);
with
return 0;
This should hopefully improve things on your desktop iMac.
Thank you!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#774 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AA3WGOHXLX6WETRLMHFWLF3SJRUHJANCNFSM4SGKABFA>.
|
Hello @Mellvik, May I know if the updated ELKS tree fixes the build problem you had on your iMac? Thank you! |
Thank you @tkchia,
if tools/build.sh is what it takes to pull and test, the test was successful! [it did pull gmp, mpfr and mpc plus some emu86 stuff.]
If a full rebuild of cross is required, let me know.
—mellvik
… 18. okt. 2020 kl. 09:42 skrev tkchia ***@***.***>:
Hello @Mellvik <https://github.com/Mellvik>,
May I know if the updated ELKS tree fixes the build problem you had on your iMac? Thank you!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#774 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AA3WGOHMBSCWEEAU7Y6B6UDSLKL5BANCNFSM4SGKABFA>.
|
Hello @Mellvik,
Thanks. Besides pulling GMP, MPFR, and MPC, did If it did try to rebuild those, then yes, it means the new setup is indeed working. Thank you! |
@tkchia,
looking closer, only the emu86 changes were actually compiled.
So I'm removing the cross dir and doing a new build.
—Mellvik
… 18. okt. 2020 kl. 14:24 skrev tkchia ***@***.***>:
Hello @Mellvik <https://github.com/Mellvik>,
if tools/build.sh is what it takes to pull and test, the test was successful! [it did pull gmp, mpfr and mpc plus some emu86 stuff.]
Thanks. Besides pulling GMP, MPFR, and MPC, did tools/build.sh also try to rebuild them (as well as GCC)?
If it did try to rebuild those, then yes, it means the new setup is indeed working.
Thank you!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#774 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AA3WGOE4PEXRXHSMK6P2GITSLLM7LANCNFSM4SGKABFA>.
|
Hello @tkchia,
I can second @Mellvik's statement that your most recent update to tools/build.sh does update the GMP .zip file but does NOT rebuilt GMP nor GCC. This was tested when I verified the EMU86 change I made yesterday. Thank you! |
OK,
FWIW - the cross dir rebuilds fine from scratch…
—M
… 18. okt. 2020 kl. 18:05 skrev tkchia ***@***.***>:
Hello @Mellvik <https://github.com/Mellvik>,
I have put out another pull request (#804 <#804>) to try to fix this. Sorry and thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#774 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AA3WGOAOKHBHUXXNZ7VQ6XLSLMG4DANCNFSM4SGKABFA>.
|
Hello @Mellvik, Thanks! Good to know that the build is working now. In that case, will it be OK to close this issue? |
Confirming that the tools now rebuild automatically. Thanks. |
Thanks for re-opening this @Mellvik. Since you're saying the current errors you are receiving is exactly the same, it sounds like perhaps the GNU MP library dependency needs to be updated again. I would jump in but can't at the moment because I need my tools working given the current activity on ELKS. Hang in there and I'll try to find a spare system! |
@ghaerr, thanks for the followup - and my apologies for reopening without submitting the description. I was interrupted - and have not had the chance to dive back in yet.
The same 'exit(0)' issue in gmp configure is part of the problem.
More later.
@Mellvik
… 17. mai 2021 kl. 16:06 skrev Gregory Haerr ***@***.***>:
Thanks for re-opening this @Mellvik. Since you're saying the current errors you are receiving is exactly the same, it sounds like perhaps the GNU MP library dependency needs to be updated again. I would jump in but can't at the moment because I need my tools working given the current activity on ELKS. Hang in there and I'll try to find a spare system!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@ghaerr, @tkchia -
Following the recipe from last time, the remaining
I've been digging though the config.log files without finding anything of interest. Hints welcome. FWIW - --Mellvik |
Hello @Mellvik , Strange. It looks like there was some sort of weird mismatch between your C(++) compiler environment when running Since the errors now occur when building
Here it seems that the auto-generated file Anyway, on my Ubuntu build system, the relevant part of
The situation for
This seems to be a deliberate choice on the part of the GCC authors. The GCC source files have a Thank you! |
Thank you @thchia, turns out - as you suspected, that removing resource.h and 'has strsignal' from gcc/configure provides for a successful compile. I haven't figured out how to make that happen automagically yet, will dive back into it later today. --Mellvik |
Hello @Mellvik, Does Thank you! |
@tkchia, Since the toolchain compiles and works on my MacMini (running Mojave), I moved my work to that machine for now, until I get the time to dive further into the issue. Pending that, it makes sense to keep this issue open. --M |
Hello @Mellvik, Did this issue ever get resolved? And/or is it specific to a single macOS machine/OS version you have? Thank you! |
Hello @Mellvik, Should this issue remain open? Thank you! |
Yes, this one's still open.
I'm running ELKS development off of a Mojave based mac,
on newer OSes the toolchain compile fails. A real pain, but not bad enough to dive even deeper yet.
Is your experience differently by any chance?
—M
… 8. feb. 2022 kl. 18:54 skrev Gregory Haerr ***@***.***>:
Hello @Mellvik <https://github.com/Mellvik>,
Should this issue remain open?
Thank you!
—
Reply to this email directly, view it on GitHub <#774 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AA3WGOBXZ34BSY6WLPQFAOTU2FKEXANCNFSM4SGKABFA>.
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.
|
No, I'm running Mohave myself since I need older licensed copies of Word to run and they won't run on 64-bit Catalina! |
As of XCODE Version 13.3.1 (13E500a) the ELKS toolchain compiles fine on MacOS Monterey (12.4). |
tools/build.sh
no longer builds on ELKS.The final output is
... but there are a number of similar situations before this
rm <some directory>.dSYM: is a directory
Clues anyone? This is on a mac, updated Xcode tools.
--Mellvik
The text was updated successfully, but these errors were encountered: