Is anyone able to provide any tests to the referenced repo before I apply any PRs to the main-line adtools?
The tests can be added to the main-line repo, but for now, you can add them (or just provide me the source code so that I can add them) to my referenced repo above.
As far as I know, at the moment, static libraries are okay, newlib and clib2. shared o is okay newlib, but not clib2.
@afxgroup One way or another, the current HEAD of clib2 needs to be fixed so that -Werror does not cause an issue wrt. the "time" structure cast we talked about.
If liberty means anything at all, it means the right to tell people what they do not want to hear. George Orwell.
As I wrote I can confirm that shared objects are working but since the elf.library has not been released is not possible to test them. The amigaos.h file is correct so don't worry about it. -Werror in beta10 has been removed. I'm waiting to merge it into master since there are some things I want to fix
As I wrote I can confirm that shared objects are working but since the elf.library has not been released is not possible to test them.
Whatever the problem with old elf.library versions was, as far as I understood it the beta versions of it you are currently using don't call the __shlib_call_constructors() and __shlib_call_destructors() functions of shared objects any more but use something else internally. That's OK for some beta testing, but of course such extremely broken versions of elf.library must never be used for any public release.
It is calling both functions. Shcrtbegin/end are used both when using -use-dynld. Don't ask me why it was broken in the past. I don't know how elf.library was working internally
You can see that I have added a 2nd test there: "2_capehill_adtools_issue_139_test_code"
You should be able to clone that while thing, run "./4afx" in the background, be left with LHA files in that test folder, transfer them to your AmigeOne, execute them and have the successfully run - iff we are all set to go.
If liberty means anything at all, it means the right to tell people what they do not want to hear. George Orwell.
Copying over the adt_tests.lha to your AmigaOne machine, extracting it, and running
execute run_all.script
Should be all that is needed. Run:
adt
on your linux machine for more information. The "user.script" is purposefully commented out to reduce the risk of GURU during the invocation of tests.
Now, I want to talk about the test (in the context of NEWLIB):
2_capehill_adtools_issue_139_test_code
This was test written to test shared object constructors and destructors. There are two issues I see with this test:
When running the run#?.script for each STATIC and DYNAMIC: In both the STATIC and DYNAMIC versions, I notice that once the MAIN function ends then no printing from STDOUT is respected, despite indirection. In other words, any printing to STDOUT from the destructor is not written to the file via indirection. So, I would like to know why redirection does not work in both of these cases.
Forgetting the run#?.script for a moment; when invoking the executable directly by running main#?.exe in each STATIC and DYNAMIC the STATIC version works okay but the DYNAMIC version only displays constructor "ctor" and not "ctor2".
I only have the public version of ELF.LIBRARY, so I am not sure if that is the issue.
To reproduce this, follow the steps listed at the begging of this post.
===
Once more, I invite anyone to add more tests to this repository - with a Pull Request I will happily pull. I will also try and get this framework integrated into ADTOOLS.
If liberty means anything at all, it means the right to tell people what they do not want to hear. George Orwell.
In both the STATIC and DYNAMIC versions, I notice that once the MAIN function ends then no printing from STDOUT is respected, despite indirection. In other words, any printing to STDOUT from the destructor is not written to the file via indirection. So, I would like to know why redirection does not work in both of these cases.
After main() ends _exit() is called which closes/frees all C library stuff, including the stdio streams. Even if interfaces and libraries are released/closed as well IDOS should still be available and working (IIRC I didn't set the interface pointers to NULL), use something like IDOS->Printf() instead for debugging output. But in case that doesn't work either the only way would be using IExec->DebugPrintF().
Edit: OTOH C library functions of course have to work in sobjs destructor functions, I can't check it since I don't have access to the newlib.library (nor any other AmigaOS) sources any more, but maybe the order of first calling __shlib_call_destructors() and then _exit() is wrong in newlib.
Using Printf from DOS worked and I updated the repository.
The test for STATIC NEWLIB with my public elf.library continues to show the second constructor not being called.
Use Objdump or similar to verify the constructor array doesn't not have any NULLs in it.
The constructor calling code, assumes the array is terminated at both ends by a NULL pointer, but in some unusual cases there can be NULL in the middle which messes it up.
That's wrong as well, according to the ELF standard it has to be ~0/-1 (0xFFFFFFFF on 32 bit systems, 0xFFFFFFFFFFFFFFFF on 64 bit systems) Const1 Const2 NULL
Even if neither the __shlib_call_constructors()/destructors() functions nor elf.library may check it it should be fixed, newer versions of binutils might depend on it.
Thank you for providing such an easy solution for compiling gcc. I managed to compile a cross-compiler using the normal adtools repository, but the script makes everything much easier.
Sadly, it does not seem to work on aarch64 (Raspberry Pi). It would be great if you could make it work on this platform, too.
Not sure if this is still valid or the thread is still monitored, but i got a discrepancy in gcc 11.3.0.
gcc (adtools build 11.3.0) 11.3.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
It says the -pipe flag is built in, but it doesn't seem to be supported?
Usage: gcc [options] file...
Options:
-pass-exit-codes Exit with highest error code from a phase.
--help Display this information.
--target-help Display target specific command line options.
--help={common|optimizers|params|target|warnings|[^]{joined|separate|undocumented}}[,...].
Display specific types of command line options.
(Use '-v --help' to display command line options of sub-processes).
--version Display compiler version information.
-dumpspecs Display all of the built in spec strings.
-dumpversion Display the version of the compiler.
-dumpmachine Display the compiler's target processor.
-print-search-dirs Display the directories in the compiler's search path.
-print-libgcc-file-name Display the name of the compiler's companion library.
-print-file-name= Display the full path to library .
-print-prog-name= Display the full path to compiler component .
-print-multiarch Display the target's normalized GNU triplet, used as
a component in the library path.
-print-multi-directory Display the root directory for versions of libgcc.
-print-multi-lib Display the mapping between command line options and
multiple library search directories.
-print-multi-os-directory Display the relative path to OS libraries.
-print-sysroot Display the target libraries directory.
-print-sysroot-headers-suffix Display the sysroot suffix used to find headers.
-Wa, Pass comma-separated on to the assembler.
-Wp, Pass comma-separated on to the preprocessor.
-Wl, Pass comma-separated on to the linker.
-Xassembler Pass on to the assembler.
-Xpreprocessor Pass on to the preprocessor.
-Xlinker Pass on to the linker.
-save-temps Do not delete intermediate files.
-save-temps= Do not delete intermediate files.
-no-canonical-prefixes Do not canonicalize paths when building relative
prefixes to other gcc components.
-pipe Use pipes rather than intermediate files.
-time Time the execution of each subprocess.
-specs= Override built-in specs with the contents of .
-std= Assume that the input sources are for .
--sysroot= Use as the root directory for headers
and libraries.
-B Add to the compiler's search paths.
-v Display the programs invoked by the compiler.
-### Like -v but options quoted and commands not executed.
-E Preprocess only; do not compile, assemble or link.
-S Compile only; do not assemble or link.
-c Compile and assemble, but do not link.
-o Place the output into .
-pie Create a dynamically linked position independent
executable.
-shared Create a shared library.
-x Specify the language of the following input files.
Permissible languages include: c c++ assembler none
'none' means revert to the default behavior of
guessing the language based on the file's extension.
Options starting with -g, -f, -m, -O, -W, or --param are automatically
passed on to the various sub-processes invoked by gcc. In order to pass
other options on to these processes the -W options must be used.
For bug reporting instructions, please see:
.
but whenever i try to use it, it errors:
ppc-amigaos-gcc: fatal error: '-pipe' not supported