Open takusuman opened 2 years ago
Ok, researching a little bit more, I came to the conclusion that, for some reason, it's trying to link everything as if it were on GNU's C library — for instance, `error_at_line
' is considered a GNU extension (as seen here https://linux.die.net/man/3/error_at_line
and here https://www.gnu.org/software/libc/manual/html_node/Error-Messages.html).
Yet this is a relevant discovery, I still do not knowing how could I fix that right now. 🤔
Any guesses, @dslm4515? (I know you have built Musl-LFS and variations of it many times, that's why I'm bothering you 🤣)
Ok, I have some updates here: apparently, this "bug" was caused because of the musl legacy compatibility headers being installed before m4. After moving /usr/include/error.h
to /usr/include/_error.h
, it compiled without any problem.
This is, of couse, a temporary fix (as we would call it here in Brazil, a "gambiarra"). This shall be fixed, maybe forcing configure options.
Well, GNU as always.
... And, of course, Void Linux had made a fix for that some time ago. https://github.com/void-linux/void-packages/blob/master/srcpkgs/m4/template#L16-L19
In fact, just force (using the cache variables) the configure script to "believe" that the C library does not have error_at_line()
nor sys/cdefs.h
, so it will use the Gnulib to provide them.
So, summarizing it: just add ac_cv_lib_error_at_line=no
and ac_cv_header_sys_cdefs_h=no
at configure
command, like this:
copacabana_chroot% ac_cv_lib_error_at_line=no \
ac_cv_header_sys_cdefs_h=no \
./configure --prefix=/usr/ccs
I think I could close this as fixed, but anyway it is a interesting bug. 😆
... And, of course, Void Linux had made a fix for that some time ago. https://github.com/void-linux/void-packages/blob/master/srcpkgs/m4/template#L16-L19
In fact, just force (using the cache variables) the configure script to "believe" that the C library does not have
error_at_line()
norsys/cdefs.h
, so it will use the Gnulib to provide them. So, summarizing it: just addac_cv_lib_error_at_line=no
andac_cv_header_sys_cdefs_h=no
atconfigure
command, like this:copacabana_chroot% ac_cv_lib_error_at_line=no \ ac_cv_header_sys_cdefs_h=no \ ./configure --prefix=/usr/ccs
Now this can be fixed just by using -legacy-compat
on LDFLAGS
when building GNU m4, since now these functions are available as link-editable libraries.
For reference: https://github.com/Projeto-Pindorama/musl-compat/commit/b1795eaded1d1f4e3535641eaf482183e99c0bcd
I'm trying to build GNU m4 (version 1.4.19) at the chroot stage, and it returns, when
CCLD
'ng the final m4 binary, linking errors related to undefined functions being referenced --- interesting enough, these functions serve to the purpose of reporting errors, such as "error_at_line
" or just "error
".Attached, there is my config.log (which ran fine, by the way) and below there's the error itself. config.log Complete gmake log (errorm4.log)
Just a quick note: I have not compiled argp-standalone nor GNU readline, since these were not specified as dependencies of GNU m4 in LFS' Dependencies appendix (https://www.linuxfromscratch.org/lfs/view/9.1-systemd/appendices/dependencies.html). I do not think this is a problem, but...
Funny enough, before a third attempt to build it, I have got "undefined reference" errors related to
rpl_*
functions, which, at least based on my little research, it was related to Gnulib; but, after I restarted the chroot environment, this error just disappeared and the "undefined reference to `error
'" errors stayed. Yes, this is confusing, I know.