Package Details: m68k-elf-gcc 10.2.0-2

Git Clone URL: https://aur.archlinux.org/m68k-elf-gcc.git (read-only, click to copy)
Package Base: m68k-elf-gcc
Description: The GNU Compiler Collection (m68k-elf)
Upstream URL: http://gcc.gnu.org
Licenses: GPL, custom, LGPL, FDL
Conflicts: m68k-elf-gcc-bootstrap
Replaces: m68k-elf-gcc-bootstrap
Submitter: doragasu
Maintainer: doragasu
Last Packager: doragasu
Votes: 3
Popularity: 0.26
First Submitted: 2017-10-27 17:31
Last Updated: 2021-01-11 14:52

Latest Comments

doragasu commented on 2021-01-09 22:14

@Un1Gfn: Thanks for the feedback. I think I should be able to remove the m68k-elf-gcc-bootstrap if I move the m68k-elf-gcc-bootstrap in newlib to the build dependencies. Otherwise, if I do not touch the newlib PKGBUILD but remove the bootstrap provide from m68k-elf-gcc, you will be able to build it, but installation will fail (because newlib depends on m68k-elf-gcc-bootstrap and m68k-elf-gcc replaces it (and wants to uninstall it).

Un1Gfn commented on 2021-01-09 02:42

@doragasu Oops I didn't know it was for baremetal. I've switched to buildroot(uClibc) now. Thanks.

BTW: m68k-elf-gcc-bootstrap provides m68k-elf-gcc. But maybe m68k-elf-gcc should not provide m68k-elf-gcc-bootstrap the other way around.

doragasu commented on 2021-01-08 16:20

@Un1Gfn: This compiler is for bare metal targets, and it uses newlib instead of glibc. Most of the C standard library functions are usable without any additional requirements. But some of them like e.g. malloc() or printf() require you to implement some syscalls like the ones you are seeing in your error tailored for your specific target. For example where do you intend printf() to output the characters? On a bare metal target it could be an UART, an embedded screen with a framebuffer device, a memory region...

For more information read newlib documentation, specifically syscalls are documented here: https://sourceware.org/newlib/libc.html#Stubs

Un1Gfn commented on 2021-01-08 09:19

test.c

#include <stdio.h>
void _start() {
  printf("abc\n");
}

build w/ m68k-elf-gcc -std=c99 -o test.out test.c

/usr/lib/gcc/m68k-elf/10.1.0/../../../../m68k-elf/bin/ld: /usr/lib/gcc/m68k-elf/10.1.0/../../../../m68k-elf/lib/libc.a(lib_a-sbrkr.o): in function `_sbrk_r':
/home/darren/.cache/yay/m68k-elf-newlib/src/newlib-build/m68k-elf/newlib/libc/reent/../../../../../newlib-3.3.0/newlib/libc/reent/sbrkr.c:51: undefined reference to `sbrk'
/usr/lib/gcc/m68k-elf/10.1.0/../../../../m68k-elf/bin/ld: /usr/lib/gcc/m68k-elf/10.1.0/../../../../m68k-elf/lib/libc.a(lib_a-writer.o): in function `_write_r':
/home/darren/.cache/yay/m68k-elf-newlib/src/newlib-build/m68k-elf/newlib/libc/reent/../../../../../newlib-3.3.0/newlib/libc/reent/writer.c:49: undefined reference to `write'
/usr/lib/gcc/m68k-elf/10.1.0/../../../../m68k-elf/bin/ld: /usr/lib/gcc/m68k-elf/10.1.0/../../../../m68k-elf/lib/libc.a(lib_a-closer.o): in function `_close_r':
/home/darren/.cache/yay/m68k-elf-newlib/src/newlib-build/m68k-elf/newlib/libc/reent/../../../../../newlib-3.3.0/newlib/libc/reent/closer.c:47: undefined reference to `close'
/usr/lib/gcc/m68k-elf/10.1.0/../../../../m68k-elf/bin/ld: /usr/lib/gcc/m68k-elf/10.1.0/../../../../m68k-elf/lib/libc.a(lib_a-lseekr.o): in function `_lseek_r':
/home/darren/.cache/yay/m68k-elf-newlib/src/newlib-build/m68k-elf/newlib/libc/reent/../../../../../newlib-3.3.0/newlib/libc/reent/lseekr.c:49: undefined reference to `lseek'
/usr/lib/gcc/m68k-elf/10.1.0/../../../../m68k-elf/bin/ld: /usr/lib/gcc/m68k-elf/10.1.0/../../../../m68k-elf/lib/libc.a(lib_a-readr.o): in function `_read_r':
/home/darren/.cache/yay/m68k-elf-newlib/src/newlib-build/m68k-elf/newlib/libc/reent/../../../../../newlib-3.3.0/newlib/libc/reent/readr.c:49: undefined reference to `read'
/usr/lib/gcc/m68k-elf/10.1.0/../../../../m68k-elf/bin/ld: /usr/lib/gcc/m68k-elf/10.1.0/../../../../m68k-elf/lib/libc.a(lib_a-fstatr.o): in function `_fstat_r':
/home/darren/.cache/yay/m68k-elf-newlib/src/newlib-build/m68k-elf/newlib/libc/reent/../../../../../newlib-3.3.0/newlib/libc/reent/fstatr.c:55: undefined reference to `fstat'
/usr/lib/gcc/m68k-elf/10.1.0/../../../../m68k-elf/bin/ld: /usr/lib/gcc/m68k-elf/10.1.0/../../../../m68k-elf/lib/libc.a(lib_a-isattyr.o): in function `_isatty_r':
/home/darren/.cache/yay/m68k-elf-newlib/src/newlib-build/m68k-elf/newlib/libc/reent/../../../../../newlib-3.3.0/newlib/libc/reent/isattyr.c:52: undefined reference to `isatty'
collect2: error: ld returned 1 exit status

fail

doragasu commented on 2020-05-24 18:57

Makes sense, added to both makedepends and optdepends. Thanks for the suggestion!

BTW I have never user freestanding mode. I have built things without using standard libraries, linking with -nostdlib. But never used -ffreestanding before.

rouhannb commented on 2020-05-24 15:41

Then perhaps you should add newlib as both a makedepend and an optdepend?

(Also, I’m not sure if you know this or not, but you can build executables without a library by using freestanding mode.)

doragasu commented on 2020-05-23 19:13

I'm sure the puzzle I am doing with the bootstrap package can be improved. But I don't think putting newlib in the makedepends is a good idea, since if you remove the library after building the compiler, resulting compiler will fail to build executables.

rouhannb commented on 2020-05-18 17:23

Should m68k-elf-newlib be added as a makedepend?