Skip to content
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

Cannot build under Lubuntu #99

Open
Fabrizio-Caruso opened this issue Sep 16, 2018 · 11 comments
Open

Cannot build under Lubuntu #99

Fabrizio-Caruso opened this issue Sep 16, 2018 · 11 comments

Comments

@Fabrizio-Caruso
Copy link

Fabrizio-Caruso commented Sep 16, 2018

build.zip

I have also installed clang but I get the same problem.
I think my system fulfils all prerequisites but I have not been able to build the 68k tool-chain:

...
--prefix=/home/brizio/m68k-amigaos --infodir=/home/brizio/m68k-amigaos/m68k-amigaos/info --mandir=/home/brizio/m68k-amigaos/share/man --disable-nls --host=i686-linux-gnu --target=m68k-amigaos"
creating cache ./config.cache
checking host system type... i686-pc-linux-gnu
checking target system type... m68k-unknown-amigaos
checking build system type... i686-pc-linux-gnu
/usr/bin/x86_64-linux-gnu-ld: cannot find Scrt1.o: No such file or directory
/usr/bin/x86_64-linux-gnu-ld: cannot find crti.o: No such file or directory
/usr/bin/x86_64-linux-gnu-ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/7/libgcc.a when searching for -lgcc
/usr/bin/x86_64-linux-gnu-ld: cannot find -lgcc
/usr/bin/x86_64-linux-gnu-ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/7/libgcc_s.so.1 when searching for libgcc_s.so.1
/usr/bin/x86_64-linux-gnu-ld: cannot find libgcc_s.so.1
/usr/bin/x86_64-linux-gnu-ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/7/libgcc.a when searching for -lgcc
/usr/bin/x86_64-linux-gnu-ld: cannot find -lgcc
collect2: error: ld returned 1 exit status
*** The command '/usr/bin/gcc -m32 -std=gnu11 -o conftest -g -O2 -Wall   conftest.c' failed.
*** You must set the environment variable CC to a working compiler.
ERROR: command "/home/brizio/amigaos-cross-toolchain/submodules/binutils-2.14/configure --prefix=/home/brizio/m68k-amigaos --infodir=/home/brizio/m68k-amigaos/m68k-amigaos/info --mandir=/home/brizio/m68k-amigaos/share/man --disable-nls --host=i686-linux-gnu --target=m68k-amigaos" failed with 1
DEBUG: restoring old value of environment variable "CC"
DEBUG: restoring old value of environment variable "CXX"
DEBUG: restoring old value of environment variable "CXXFLAGS"
DEBUG: restoring old value of environment variable "CFLAGS"
@TheFakeMontyOnTheRun
Copy link

TheFakeMontyOnTheRun commented Oct 20, 2018

Facing the same issue, even after using export CC=clang (seems to be ignored - it was invoking /usr/bin/gcc directly)
build.log

Linux monty-OptiPlex-760 4.15.0-36-generic #39-Ubuntu SMP Mon Sep 24 16:19:09 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux (Xubuntu)

@Fabrizio-Caruso
Copy link
Author

@TheFakeMontyOnTheRun I have tried to contact the author but he has not replied. I fear he may have abandoned this nice project. Someone has ported GCC for Amiga. It may be an alternative:

https://github.com/bebbo/amiga-gcc

Nevertheless I hope the author of this project pops up one day and helps us with this issue.

@chenz
Copy link

chenz commented Oct 23, 2018

This looks like there are 32bit C runtime libraries missing - only the 64bit variants are found (and skipped). Installing packages libc6-dev-i386 and lib32gcc-6-dev (speaking for Debian stretch, adjust for your version of *buntu) should get you a couple of steps further - but there may still be more libraries missing after that.

@TheFakeMontyOnTheRun
Copy link

Just yesterday, I got this one working: https://github.com/emartisoft/m68K-AmigaOS-cross-compiler-setup-script

@Fabrizio-Caruso
Copy link
Author

Thanks!
I now get:
"
In file included from /usr/include/bits/errno.h:26:0,
from /usr/include/errno.h:28,
from /home/brizio/amigaos-cross-toolchain/submodules/binutils-2.14/libiberty/fnmatch.c:46:
/usr/include/linux/errno.h:1:10: fatal error: asm/errno.h: No such file or directory
#include <asm/errno.h>
^~~~~~~~~~~~~
compilation terminated.
Makefile:125: recipe for target 'fnmatch.o' failed
make[1]: *** [fnmatch.o] Error 1
make[1]: Leaving directory '/home/brizio/amigaos-cross-toolchain/.build-m68k/build/binutils-2.14/libiberty'
Makefile:3528: recipe for target 'all-libiberty' failed
make: *** [all-libiberty] Error 2
ERROR: command "make -j1" failed with 2
DEBUG: restoring old value of environment variable "CC"
DEBUG: restoring old value of environment variable "CXX"
DEBUG: restoring old value of environment variable "CXXFLAGS"
DEBUG: restoring old value of environment variable "CFLAGS"

"

@Fabrizio-Caruso
Copy link
Author

@TheFakeMontyOnTheRun I can build the cross compiler but no stdio lib is found. I was expecting some minimal lib support. Is this expected?

@TheFakeMontyOnTheRun
Copy link

Try switching the C runtime library (there are a few alternatives).
Unfortunately, I could not work on any Amiga project any further.

@Fabrizio-Caruso
Copy link
Author

Fabrizio-Caruso commented Dec 1, 2018

@TheFakeMontyOnTheRun How? The help option does not help much but
I have tried /opt/m68k-amigaos/bin/m68k-amigaos-gcc -noixemul hello.c
I have no idea if this works.
I still need to try it on an Amiga emulator. Need to find out how to transfer the binary.

@terriblefire
Copy link

I've dug into this. It seems to be because we're running gcc 7 which doesnt like the -V option.

@terriblefire
Copy link

terriblefire commented Mar 26, 2020

I dug in even deeper. Seems (for me anyway) the compiler could produce 32 bit exe's but the system couldnt execute them. If you think this is your issue you can compile a hello world with -m32

@jbilander
Copy link

I have a working build downloadable here for a while:

http://files.creang.com/

built with the command below on Ubuntu 18.04 LTS on x86_64

./toolchain-m68k --prefix=/opt/m68k-amigaos build 2>&1 | tee buildlog.txt

I archived it with the following command if anyone needs it:

jbilander@apollo:/opt$ sudo tar -czvf m68k-amigaos.tar.gz ./m68k-amigaos/
./m68k-amigaos/
./m68k-amigaos/include/
./m68k-amigaos/lib/
.
.

Unpack it in /opt and it should work on later Ubuntus as well I think, add the PATH last in your .bashrc or similar, like this

export PATH="/opt/m68k-amigaos/bin:$PATH"

after a new login, check with the "env" command you should have the correct PATH in there, early in the path.

Hope it helps, -jb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants