Elks fails to compile on Debian 12 due to libc failing to compile. typo maybe?
Description
- What is expected ?
- to compile the images
- What is observed ?
- it stops very VERY quickly
Configuration
- Version (commit or release):
- latest
- Emulator or HW platform:
- IBM PC
How to reproduce ?
- Does the problem always happen ?
- yes yes
- List the steps to reproduce the problem.
- try to run ./build.sh
Raw data
- Screenshot(s):
- Log file:
*
* You may now run `make clean` and `make` to build.
Cleaning all...
make -C libc clean
make[1]: Entering directory '/home/sparky4/p/elks/libc'
for DIR in asm ctype debug error gcc getent malloc math misc net regex stdio string system termcap termios time ; do make -C $DIR clean || exit 1; done
make[2]: Entering directory '/home/sparky4/p/elks/libc/asm'
Makefile:23: *** target pattern contains no '%'. Stop.
make[2]: Leaving directory '/home/sparky4/p/elks/libc/asm'
make[1]: *** [Makefile:240: clean] Error 1
make[1]: Leaving directory '/home/sparky4/p/elks/libc'
make: *** [Makefile:36: clean] Error 2
Build script has terminated with error 4
Additional information Add any other context information about the problem here.
I am compiling for ibm pc
It seems there may be an incompatibility with the make you are running? Can you run make --version? My version of make is GNU v3.81. It seems the error is occurring quite quickly during make clean. Try that alone to confirm.
C:\home\sparky4\p\elks> make --version GNU Make 4.3 Built for x86_64-pc-linux-gnu Copyright (C) 1988-2020 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
This is quite strange; have you tried building before using exactly this method? I am trying to ascertain whether this is a new issue, or perhaps something to do with Debian 12.
Are you running Debian or Windows? I see your path is C:\home\sparky4\p\elks: that's Windows isn't it? The ELKS build is completely untested on Windows. I found the following post explaining that having a backslash in your PATH can cause this problem.
Can you try a simple make clean, then make, to see if that works? If not, then we're likely dealing with incompatibility with your system using Windows-style pathnames separated with backslashes; I won't have a fix for that.
oh the prompt thing is a custom one dont worry the actual pwd is
C:\home\sparky4\p\elks> pwd
/home/sparky4/p/elks
i think it's a new issue. i was able to compile it before. i dont know what happened the last few months. i just cannot make libc anymore
If this is a fresh install of Debian then you need to do something like that in the beginning: apt install build-essential or remove your old copy of elks source and git clone again.
I am using WSL (Windows Subsystem for Linux)/Ubuntu 20. I did git pull and I managed to compile ELKS on the second time. First time there was some error, but it works for me.
I'm on Debian 12 as well. Same make version as well. Works. It does not look like ELKS build uses your (exotic) $PS1 to set something odd, but I'm not sure about it much, so maybe try to change it to debian default (and have a clean git clone of ELKS as toncho11 mentioned).
It does not look like ELKS build uses your (exotic) $PS1 to set something odd, but I'm not sure about it much, so maybe try to change it to debian default
Agree, I would try changing the prompt, just in case.
oh ok ill do that
nope still not compiling
Are you running ./build.sh or make clean? The latter is preferred. It also looks like perhaps you may not have configured ELKS. The preferred way to do this is:
$ make menuconfig
(check that .config exists)
$ make clean
$ make
Don't run ./build.sh, it may be contributing to the problem?
I would also run the above without any fancy prompt - it looks like you may be running a prompt with a linefeed in it? Try with standard PS1= to eliminate variables, since both @toncho11 and @floriangit are saying this is working fine for them.
I see you got an earlier "ELKS is not configured yet" as well as an error in "Keymaps" directory... it appears as though the build.sh script is continuing and not stopping with errors, which will contribute to the problem. You might want to do as @toncho11 suggested and remove everything and start with a git clone or git pull from scratch, and then only use "make" as described above, no shell scripts.
ok ill do that
You're still running a shell script. That's not 'make clean' by itself.
Nonetheless, something is definitely wrong with the build environment. I don't know what it is, and I cannot duplicate it since I don't have a Windows or Linux box.
The screenshots don't show enough history for me to see what you are doing. I will need a complete execution history in order to debug more. It is possible that the cross development environment is improper, because that is more closely connected to the C library build. You might try 'make kimage' to attempt a kernel only build. I also need you to tell me the results of the explicit instructions that I gave you a couple posts ago.
I had a chance to download debian-12.7.0-amd64-DVD-1.iso. I may try to install it later.
Hello from Debian 12.7. OK, I got the system up. I will try to get elks environment later this week.
let me build the kernel then
it is working! :D
If it is now working, I suspect the problem was/is that you were running ./build.sh, a shell script that doesn't work with WSL, while make, make clean or make kimage works. Please confirm.
make and make clean never worked but make kimage works just fine
make kimage is only for kernel, right?
yeah it seems
Hi @sparky4
Are you using build.sh in the repository root or are you using tools/build.sh?
I am now following steps here that uses tools/build.sh https://github.com/ghaerr/elks/blob/master/BUILD.md
I am still building the compiler but it seems that mtool in my Debian is v4.0.33. That may not work for PC-98. https://github.com/ghaerr/elks/pull/1463