14 April 2021, 00:38 | #1 |
Registered User
Join Date: Jun 2020
Location: Scotland
Posts: 146
|
Cross-Compiling and libs
Hi folks,
Another probably-basic question because I'm not very familiar with cross compiling under gcc (I've been using vbcc). On a bit of a whim I thought I'd see whether I could get ruby building for the classic amiga. The source is downloadable and its a standard configure/make process on most unixy platforms (I'm on an intel Mac). I have bebbos gcc toolchain installed and working very well for building stuff I wrote myself, no configure step necessary. It lives in /opt/amiga and the /opt/amiga/bin contains eg m68k-amigaos-gcc I go into the ruby source dir and type ./configure --source m68k-amigaos and I get pretty far through...until. Code:
configure: error: clock_gettime() or gettimeofday() must exist I know its a bit of a niche question, but I figure there's a lot of people here used to doing this kind of stuff :-). Thanks in advance for any suggestions, Alan |
14 April 2021, 01:18 | #2 |
Registered User
Join Date: Jun 2020
Location: Scotland
Posts: 146
|
Just remembered this other post http://eab.abime.net/showthread.php?t=105897 which also had a problem with gettimeofday() :-/. So...
Code:
CFLAGS=-mcrt=clib2 ./configure --host m68k-amigaos Code:
m68k-amigaos/bin/nm: sorry - this program has been built without plugin support |
14 April 2021, 01:32 | #3 |
Registered User
Join Date: Jun 2020
Location: Scotland
Posts: 146
|
Final update of the evening is that I'm now stuck getting it to recognise /opt/amiga/m68k-amigaos/lib/libpthread.a
Code:
checking for pthread_create in -lthr... no checking for pthread_create in -lpthread... no checking for pthread_create in -lpthreads... no checking for pthread_create in -lc... no checking for pthread_create in -lc_r... no checking for pthread_create in -lroot... no configure: WARNING: "Don't know how to find pthread library on your system -- thread support disabled" |
14 April 2021, 08:46 | #4 | ||
bye
Join Date: Jun 2016
Location: Some / Where
Posts: 680
|
Quote:
I recommend using -libnix aka -mcrt=nix20 instead of clib2. Quote:
use the prefixed programs in $PREFIX/bin -> $PREFIX/bin/m68k-amigaos-nm |
||
14 April 2021, 17:51 | #5 |
Registered User
Join Date: Jun 2020
Location: Scotland
Posts: 146
|
@bebbo
I tried -mcrt=nix20 and configure stopped dead at "checking your c compiler is working" :-/. I hate that I can't find useful information to help me debug this stuff beyond a "it didn't work" error message. I feel like a 5 year old :-) As regards a different nm I'm not sure how to point at those binaries beyond the --host m68k-amigaos that I am already using ? |
14 April 2021, 18:15 | #6 |
Registered User
Join Date: Jun 2020
Location: Scotland
Posts: 146
|
I think the nm problem is just a bad error message, it has managed to auto-translate ranlib -> m68k-amigaos-ranlib for example. My thought is that it *is* using the correct binary but in the amiga-gcc/Makefile I see --disable-plugins
https://github.com/bebbo/amiga-gcc/b.../Makefile#L335 hence "this program has been built without plugin support" |
14 April 2021, 20:52 | #7 |
Registered User
Join Date: Jun 2020
Location: Scotland
Posts: 146
|
So I changed that line in the amiga-gcc Makefile and rebuilt everything with --enable-plugins. On a whim I tried mcrt=nix20 so I could get the right error message to paste here, and I'll be damed but it worked right the way through.
Code:
CFLAGS=-mcrt=nix20 ./configure --host m68k-amigaos --enable-threads=posix Code:
checking for m68k-amigaos-gcc-nm... m68k-amigaos-gcc-nm checking for m68k-amigaos-m68k-amigaos-gcc-ranlib... no checking for m68k-amigaos-gcc-ranlib... m68k-amigaos-gcc-ranlib checking for m68k-amigaos-gcc... (cached) m68k-amigaos-gcc checking whether the C compiler works... no configure: error: in `/Users/acf/work/ruby-3.0.1': configure: error: C compiler cannot create executables |
14 April 2021, 21:05 | #8 |
Registered User
Join Date: Jun 2020
Location: Scotland
Posts: 146
|
Notes mostly for myself and anyone else who tries this later.
First thing I needed to do was define HAVE_GCC_ATOMIC_BUILTINS=1 to make include/ruby/atomic.h happy. Have now hit an issue where coroutine/ucontext/Context.h is looking for <ucontext.h> which appears to be part of glibc but isn't present in opt/amiga. Investigations continue. :-) https://github.com/lattera/glibc/blo...sys/ucontext.h Last edited by alancfrancis; 14 April 2021 at 21:18. |
19 January 2023, 17:35 | #9 |
Registered User
Join Date: Mar 2020
Location: Boulder Creek / USA
Posts: 43
|
Have you ever figured it out? Curious as I am looking around to see who has accomplished what with regards to Ruby on the Amiga. @alancfrancis
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Docker and cross compiling for Amiga platforms | Marlon_ | Coders. General | 3 | 28 June 2019 22:18 |
Help with gcc cross-compiling | MartinW | Coders. C/C++ | 7 | 21 April 2017 13:22 |
Cross compiling to the Amiga with Sozobon | RedskullDC | Coders. Language | 2 | 08 December 2016 03:25 |
Cross Compiling / Environment Info | Zetr0 | Coders. General | 10 | 09 November 2016 20:28 |
cross-compiling Basic for Amiga | nitrofurano | Coders. Language | 4 | 19 November 2013 20:47 |
|
|