Re: cross-compile skalibs

From: Laurent Bercot <ska-skaware_at_skarnet.org>
Date: Wed, 18 Sep 2019 07:50:30 +0000

>> It's a difference whether you have to run the entire configure stage
>> for a new target on the target first or know maybe platform, cpu,
>> library or kernel issues before and can "cache" these ;)

You mean... like adding specific -l flags and a list of kernel issues
to a database you then read from? :P

Again, you can't get around this, no matter what words you employ to
describe the mechanism. Either you have a sysdeps database, and things
work, or you don't, and they don't. You seem to believe that autotools
somehow performs magic that other build systems don't; I can assure you
it's not the case.


>> Case A and B are seriously no problem when the configuration script
>> respect CPP, CPPFLAGS, CC, CFLAGS, CXX, CXXFLAGS, LD, LDFLAGS,
>> LDDLFLAGS, CCLD, CCLDFLAGS, ... for HOST_*, BUILD_* and TARGET_*
>>
>> skaware doesn't - so the first failure came by not respecting
>> --sysroot=/path/to/... options for cc and ld etc.

skaware configure scripts respect CC, CFLAGS, CPPFLAGS and LDFLAGS.
And that's all that's needed to make the build work in all cases.


>> Yes, that is probably a real question. OTOH - why do you care?
>> Is it, because you might call malloc(0) and the returned MULL
>> is handled as an error? Is there a sane way to handle the memory
>> management by not relying on that quirk?

There are many ways to handle memory management while working around
that quirk, but it's a brain tax on the application developer, who
has better things to think about; and when you add quirk after quirk
after quirk, writing portable programs becomes a nightmare.
Working around quirks is precisely one of the things that skalibs does,
so it's its *job* to care about those things.


>> Would it be sane to just provide those sysdeps you can't probe?

Yes, absolutely. Finally we're making progress. :)


>> That's why I suggested autoconf. By default, anything is guessed.
>> And those which can't, can be provided by flags or ac_av_$check.

My (main) criticism of autoconf is that when you don't provide those
values, autoconf guesses *anyway*. And that is bad.
If you're on the same page as I am that some sysdeps need to be
hand-provided (or extracted from a database indexed by hw arch, kernel
and libc, that would be the dream), no matter the build system, then
we can move forward.


>BTW: It was seriously meant offering help in doing the
>conversion. And I have no inhibition using AC_RUN_IFELSE
>where necessary.

I appreciate the offer. However, there is no way skalibs is going
to use autoconf. autoconf has other problems that makes it unfit
for skaware - lack of simplicity, for one.

What I *can* do, though, is change the skalibs build system so that
on cross-compilation, you only need to provide the few sysdeps that
cannot be probed at all.
It would probably even be possible to provide those sysdeps in the
form of ac_cv_$something environment variables to configure, if you
insist (but I can't commit to that before starting to work on the
thing and seeing what format would be easier to deal with).

How does that sound?

--
Laurent
Received on Wed Sep 18 2019 - 07:50:30 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:38:49 UTC