Repository navigation
Fix building sak with cross-compilers - #13804
Conversation
|
As a non-expert I looked at whether I could close my eyes and merge it right away. My assessment is "not quite":
|
There was a problem hiding this comment.
-
b5b1daa Prefer Autoconf EXEEXT to our exeext
LGTM -
b8cdedb Reformat an AS_IF
LGTM -
034f8b7 Fix sak build not using the proper build compiler invocation
I don’t understand what use cases this is fixing (I see the changes of extensions in cross-compiler setups but is there anything more than aesthetic considerations?).
I agree that this is introducing quite some variables. To avoid the$(BUILD_O)for instance, I would rather go that way:- merge the rules for
sakinto one (separating compilation from linking is not really useful there), - define a do-it-all
SAK_BUILDvariable inMakefile.build_config.inset up duringconfigure, - if the extension of the
sakbinary really matters (note that we often use.exeextensions on Unix...), defineSAKalso inconfigure/Makefile.build_config.in.
But I like the idea of defining
outputobjandoutputexeat the same place inconfigure.ac! - merge the rules for
$ clang-20 -Foruntime/sak.o -c runtime/sak.c
$ clang-20 -o runtime/sak runtime/sak.o
clang-20: error: no such file or directory: 'runtime/sak.o'
clang-20: error: no input filesI'm using here clang-20 for the build compiler, but with a
I agree this could be cleaner, but if we build sak using I think dra27 has plans to remove sak, so introducing these build variables could be seen as temporary. |
Autoconf detects `.exe` on all Windows targets. OBJEXT and EXEEXT are automatically substituted.
The AX_PROG_CC_FOR_BUILD macro has fixes from revision 21 to 26 that are needed, or it would overwrite OBJEXT and EXEEXT with BUILD_OBJEXT and BUILD_EXEEXT without defining the latter.
|
I've managed to make a single invocation to build sak. MSVC still generates a The |
shym
left a comment
There was a problem hiding this comment.
Thank you for that update!
I prefer that version and it looks good to me, I have only minor stylistic suggestions.
sak doesn't need separate compilation and linking stages, and this avoids adding build-specific variables to the Makefiles. Co-authored-by: shym <samuel@tarides.com>
The build and target compiler invocations may differ. For instance, if cross-compiling with build/host
x86_64-*-linuxand targetx86_64-pc-windows, the build/host object extension is.o, but the target uses.obj.The
AX_PROG_CC_FOR_BUILDmacro has fixes from revision 21 to 26 that are needed, or it would overwriteOBJEXTandEXEEXTwithBUILD_OBJEXTandBUILD_EXEEXTwithout defining the latter.A subtlety is that building on Windows for native Windows targets isn't cross-compiling, thus it's not the build compiler for sak (
*-pc-cygwin/*-pc-msys) that is used, but the host/target compiler.cc @shym