Closed wiremoons closed 1 year ago
Why specify --libdir=$HOME/ada/lib/gcc/11
rather than leaving the build to its own devices (as far as this is concerned, anyway!)
sorry I have not had chance to look at this so far...
e.g. x86_64-darwin18:
ld: warning: directory not found for option '-L/opt/iains/x86_64-apple-darwin18/gcc-12-0-1/lib/gcc/x86_64-apple-darwin18/12.0.1/adalib/'
.. thus it should be filed in the GCC bugzilla so that the Adacore folks can take a look at it.
NOTE: that GCC does, during the build process, inject the final installation directories in a number of places - this is not usually an issue (but I'd be first to say it would be nice to reduce build warning output).
I get the error:
ld: warning: directory not found
Not an error!
Because of the amazing amount of noise, I’ve tended to regard anything that doesn’t stop the build as uninteresting unless something about the complete build justifies further investigation.
Anyway, I still don’t get why --libdir
?
I get the error:
ld: warning: directory not found
Not an error!
Well, at the risk of defending an undesirable situation (that we get non-fatal build warnings, which we do)...
... during the build, the compiler constructs command lines with the final installation paths + the temporary ones for the build directories. Therefore, because the install directories are absent (at that stage) the linker warns about it.
The actual error would be if a dependent library could not be found - and that, of course, would stop the build.
If we wanted to avoid this, I suppose we'd have to have different sets of paths for the build and installed compilers - and that's kind of tricky because some of those paths are part of the build. It is much easier to append -B and -L for the build directories.
Because of the amazing amount of noise, I’ve tended to regard anything that doesn’t stop the build as uninteresting unless something about the complete build justifies further investigation.
I think we all do that [or, at least, investigate once and then blank out the relevant cases] ... I did make a build of ranlib that does not report the 'no symbols in' for empty objects since in a GCC build (and LLVM, for that matter) .. that is just noise.
Anyway, I still don’t get why
--libdir
?
Well, I can't speak for the OP - but distributions do choose their own layout to enable management of installing multiple GCC versions. .. as it happens Ada's libs are always stored in a versioned directory .. but the other compiler runtime libraries are not (thus you need to do something if you want to have multiple GCC versions in the same PATH).
anyway - this particular issue is not specific to the arm64 port, so if folks want to pursue it further - it would be better to file a GCC bugzilla PR (any fix for this would need to be made to GCC master and then pulled across to the arm64 branches).
Thanks for looking at the issue @iains. If it is an upstream concern, then happy to close here. I wasn't sure of the cause - so thank for the explanations in the messages exchanged above.
The reason for --libdir
was as you explained - that I had multiple installs/builds, and wanted to ensure the different builds used their own GCC compiled versions.
I am going to close this here - please note the upstream Bugzilla report if you opened one, for reference.
Hi
When building
GNAT
(Ada) I get the error:ld: warning: directory not found for option '-L/Users/simon/ada/lib/gcc/11/gcc/aarch64-apple-darwin21/12/adalib/'
when the finalxg++
step is run.The directory it is unable to find in the reported error does not exist yet, as that is the destination directory that will only exist once
make install
is run following the build, as it is part of the--prefix=$HOME/ada
path for the build.If an empty directory is created with:
mkdir -p /Users/simon/ada/lib/gcc/11/gcc/aarch64-apple-darwin21/12/adalib/
andmake
is re-run following the error, then the compile finishes without any issues.Is it an error in the generated
Makefile
using the target path instead of thebuild
path perhaps?Full output of the failing part is below:
The build
Makefile
was created with:Other supporting details of the system being used to build are below - but let me know if you need any further information.