1. We need our C/C++ stdlib headers to be brought up-to-date with the latest standard. Especially cmath. Newlib is missing multiple functions (log2(), asinh(), etc.). 2. Newlib also has gaps in its POSIX compliance. It's missing basics such as tzset()**
Unfortunately I have more time consuming hobbies than time :)
One big problem though, is that it looks like an endless pit of work. But it probably isn't if we can chop it up into pieces and distribute the work. If we'd 'just' start stubbing things to get it to build, then we'd have a list of gaps that we can work with, setting priorities, estimating effort (and perhaps creating bounties based on that) and so on. This might be a big task in itself of course.
@sTix Hello there. I tried to compile gcc 10 for using with cross compiling, and I had the following errors
In file included from /opt/adtools/gcc/repo/libstdc++-v3/src/c++17/fs_ops.cc:58:
/opt/adtools/gcc/repo/libstdc++-v3/src/c++17/../filesystem/ops-common.h: In function ‘int std::filesystem::__gnu_posix::truncate(const char*, off_t)’:
/opt/adtools/gcc/repo/libstdc++-v3/src/c++17/../filesystem/ops-common.h:158:13: error: ‘ENOTSUP’ was not declared in this scope
158 | errno = ENOTSUP;
| ^~~~~~~
/opt/adtools/gcc/repo/libstdc++-v3/src/c++17/../filesystem/ops-common.h: In function ‘bool std::filesystem::do_copy_file(const char_type*, const char_type*, std::filesystem::copy_options_existing_file, std::filesystem::__gnu_posix::stat_type*, std::filesystem::__gnu_posix::stat_type*, std::error_code&)’:
/opt/adtools/gcc/repo/libstdc++-v3/src/c++17/../filesystem/ops-common.h:355:39: error: ‘not_supported’ is not a member of ‘std::errc’
355 | ec = std::make_error_code(std::errc::not_supported);
| ^~~~~~~~~~~~~
/opt/adtools/gcc/repo/libstdc++-v3/src/c++17/../filesystem/ops-common.h:363:43: error: ‘not_supported’ is not a member of ‘std::errc’
363 | ec = std::make_error_code(std::errc::not_supported);
| ^~~~~~~~~~~~~
/opt/adtools/gcc/repo/libstdc++-v3/src/c++17/../filesystem/ops-common.h:394:43: error: ‘not_supported’ is not a member of ‘std::errc’
394 | ec = std::make_error_code(std::errc::not_supported);
| ^~~~~~~~~~~~~
/opt/adtools/gcc/repo/libstdc++-v3/src/c++17/../filesystem/ops-common.h: In function ‘void std::filesystem::do_space(const char_type*, uintmax_t&, uintmax_t&, uintmax_t&, std::error_code&)’:
/opt/adtools/gcc/repo/libstdc++-v3/src/c++17/../filesystem/ops-common.h:553:42: error: ‘not_supported’ is not a member of ‘std::errc’
553 | ec = std::make_error_code(std::errc::not_supported);
| ^~~~~~~~~~~~~
/opt/adtools/gcc/repo/libstdc++-v3/src/c++17/fs_ops.cc: In function ‘void std::filesystem::copy(const std::filesystem::__cxx11::path&, const std::filesystem::__cxx11::path&, std::filesystem::copy_options, std::error_code&)’:
/opt/adtools/gcc/repo/libstdc++-v3/src/c++17/fs_ops.cc:363:44: error: ‘not_supported’ is not a member of ‘std::errc’
363 | ec = std::make_error_code(std::errc::not_supported);
| ^~~~~~~~~~~~~
/opt/adtools/gcc/repo/libstdc++-v3/src/c++17/fs_ops.cc: In function ‘void std::filesystem::create_hard_link(const std::filesystem::__cxx11::path&, const std::filesystem::__cxx11::path&, std::error_code&)’:
/opt/adtools/gcc/repo/libstdc++-v3/src/c++17/fs_ops.cc:695:40: error: ‘not_supported’ is not a member of ‘std::errc’
695 | ec = std::make_error_code(std::errc::not_supported);
| ^~~~~~~~~~~~~
/opt/adtools/gcc/repo/libstdc++-v3/src/c++17/fs_ops.cc: In function ‘void std::filesystem::create_symlink(const std::filesystem::__cxx11::path&, const std::filesystem::__cxx11::path&, std::error_code&)’:
/opt/adtools/gcc/repo/libstdc++-v3/src/c++17/fs_ops.cc:719:40: error: ‘not_supported’ is not a member of ‘std::errc’
719 | ec = std::make_error_code(std::errc::not_supported);
| ^~~~~~~~~~~~~
/opt/adtools/gcc/repo/libstdc++-v3/src/c++17/fs_ops.cc: In function ‘bool std::filesystem::equivalent(const std::filesystem::__cxx11::path&, const std::filesystem::__cxx11::path&, std::error_code&)’:
/opt/adtools/gcc/repo/libstdc++-v3/src/c++17/fs_ops.cc:850:41: error: ‘not_supported’ is not a member of ‘std::errc’
850 | ec = std::make_error_code(std::errc::not_supported);
| ^~~~~~~~~~~~~
/opt/adtools/gcc/repo/libstdc++-v3/src/c++17/fs_ops.cc: In function ‘uintmax_t std::filesystem::file_size(const std::filesystem::__cxx11::path&, std::error_code&)’:
/opt/adtools/gcc/repo/libstdc++-v3/src/c++17/fs_ops.cc:964:39: error: ‘not_supported’ is not a member of ‘std::errc’
964 | ec = std::make_error_code(std::errc::not_supported);
| ^~~~~~~~~~~~~
/opt/adtools/gcc/repo/libstdc++-v3/src/c++17/fs_ops.cc: In function ‘void std::filesystem::last_write_time(const std::filesystem::__cxx11::path&, std::filesystem::file_time_type, std::error_code&)’:
/opt/adtools/gcc/repo/libstdc++-v3/src/c++17/fs_ops.cc:1083:40: error: ‘not_supported’ is not a member of ‘std::errc’
1083 | ec = std::make_error_code(std::errc::not_supported);
| ^~~~~~~~~~~~~
/opt/adtools/gcc/repo/libstdc++-v3/src/c++17/fs_ops.cc: In function ‘void std::filesystem::permissions(const std::filesystem::__cxx11::path&, std::filesystem::perms, std::filesystem::perm_options, std::error_code&)’:
/opt/adtools/gcc/repo/libstdc++-v3/src/c++17/fs_ops.cc:1132:42: error: ‘not_supported’ is not a member of ‘std::errc’
1132 | ec = std::make_error_code(std::errc::not_supported);
| ^~~~~~~~~~~~~
/opt/adtools/gcc/repo/libstdc++-v3/src/c++17/fs_ops.cc: In function ‘std::filesystem::__cxx11::path std::filesystem::read_symlink(const std::filesystem::__cxx11::path&, std::error_code&)’:
/opt/adtools/gcc/repo/libstdc++-v3/src/c++17/fs_ops.cc:1211:40: error: ‘not_supported’ is not a member of ‘std::errc’
1211 | ec = std::make_error_code(std::errc::not_supported);
| ^~~~~~~~~~~~~
make[10]: *** [Makefile:570: fs_ops.lo] Error 1
make[10]: *** Waiting for unfinished jobs....
make[10]: Leaving directory '/opt/adtools/native-build/gcc-cross-build-10.1.0/ppc-amigaos/clib2/libstdc++-v3/src/c++17'
make[9]: *** [Makefile:731: all-recursive] Error 1
make[9]: Leaving directory '/opt/adtools/native-build/gcc-cross-build-10.1.0/ppc-amigaos/clib2/libstdc++-v3/src'
make[8]: *** [Makefile:563: all-recursive] Error 1
make[8]: Leaving directory '/opt/adtools/native-build/gcc-cross-build-10.1.0/ppc-amigaos/clib2/libstdc++-v3'
make[7]: *** [Makefile:488: all] Error 2
make[7]: Leaving directory '/opt/adtools/native-build/gcc-cross-build-10.1.0/ppc-amigaos/clib2/libstdc++-v3'
make[6]: *** [Makefile:856: multi-do] Error 1
make[6]: Leaving directory '/opt/adtools/native-build/gcc-cross-build-10.1.0/ppc-amigaos/libstdc++-v3'
make[5]: *** [Makefile:824: all-multi] Error 2
make[5]: Leaving directory '/opt/adtools/native-build/gcc-cross-build-10.1.0/ppc-amigaos/libstdc++-v3'
make[4]: *** [Makefile:563: all-recursive] Error 1
make[4]: Leaving directory '/opt/adtools/native-build/gcc-cross-build-10.1.0/ppc-amigaos/libstdc++-v3'
make[3]: Leaving directory '/opt/adtools/native-build/gcc-cross-build-10.1.0/ppc-amigaos/libstdc++-v3'
make[3]: *** [Makefile:488: all] Error 2
make[2]: *** [Makefile:11345: all-target-libstdc++-v3] Error 2
make[2]: Leaving directory '/opt/adtools/native-build/gcc-cross-build-10.1.0'
make[1]: *** [Makefile:956: all] Error 2
make[1]: Leaving directory '/opt/adtools/native-build/gcc-cross-build-10.1.0'
make: *** [makefile:192: gcc-cross-done-10.1.0] Error 2
I used g++-10 to compile it on Linux, and the following commands.
@walkero Don't you forget before to change the SDK link on the newer one in /amiga/adtools/native-build/makefile ? Because I doing it exactly as you say, just with of course changed the link to SDK.
Also, you may try first to not use -j4 , until it downloads and unpacks SDK, and then break the process and restart with -j4.
@sTix May I ask you if you still worry about, to enable for further tests "pthread" threading as well ?
Currently, we have only "AmigaOS-native" threading enabled (that is this gthr-amigaos-native.c, from the amiga-native-thread patch), but there is also gthr-amigaos-posix.c , so to have POSIX based threading works (via pthreads).
As Sebastian says a year ago, the pthread wrapper is already there, but not bundled yet. This is that gthr-amigaos-posix.c
Currently if we just trying to compile with -athread=pthread, we have "ppc-amigaos/bin/ld: cannot find gthr-amigaos-pthread.o: No such file or directory".
So to have it bundled we need to fix 2 issues:
1). file gthr-amigaos-posix.c didn't compiles at all and didn't placed to the /usr/local/amiga/lib/gcc/ppc-amigaos/10.1.0/ directory.
So we need to add it adtools build process (like done for qthr-amigaos-native.c).
2). even if we compile it and place when amigaos-native one placed, then when we choose "-athread=pthread", it asks for gthr-amigaos-pthread.o, and not gthr-amigaos-posix.o (see name clash pthread vs posix).
In other words, all we need to do is copy the way how gthr-amigaos-native file is compiled/placed, and or name on compiling-object stage it as gthr-amigaos-pthread.o, or, change -athread=pthread option to -athread=posix option and keep the name of original c file and of an object the same.
I already can compile that gthr-amigaos-posix.c to gthr-amigaos-pthread.o and use it with -athread=pthread, but will be fine to bundle it by default so it can be futher bug-tracked and improved too
Right now I'm digging into the problems with things not being exposed in the 'std' namespace. I'd also like to get a good picture of the gaps in clib2. This will probably take some time so I don't want to make any promises, but if no one does it in the meantime I can have a look.
@sTix At least all the std:: issues I reported, all of them implemented and works when I just remove std::. So chances high it just some configuring issues.
For your info, I created new docker images that have the gcc 8 and 9 from sba1 repo and gcc 10 from sodero repo already compiled, if anyone wants to use them on cross compiler development environment.
Unfortunately -fanalyzer doesn't work locally (at least for ScummVM)
I get my memory filled up by it pretty early on when compiling commandLine.cpp. It grows to 77% filled and then ccplus11 errors with a "cannot allocate 104 bytes".
@sTix Maybe you can do a pull-request will the latest gcc9 and gcc10 you had in your branches to the original adtools repo? I am already on gcc10 for some time, it surely not worse than gcc8.x for us. And having it in adtools repo will help everyone to not mess between different repos.