swipl-devel
swipl-devel copied to clipboard
swipl-ld looks for non-existent flags + some missing "help"
swipl-ld looks for these flags that don't exist from swipl --dump-runtime-variables
:
PLLIBS
(this has a comment "Always required")
PLLDFLAGS
PLCFLAGS
These are missing from "help":
-pg*
-g3
-gdward-*
and the following causes strange things to happen (seems to dump a bunch of environment variables, using printenv
, onto the swipl
command):
-pl-options '--no-pce'
but this does what's expected: -pl-options=--no-pce
.
So, I think we need to document which options take a =
.
(I can make the changes, but first I want to know if there's a bug with the 3 flags that I mentioned at the beginning of this bug report)
It all looks pretty much outdated. Not really sure whether it should be refreshed a little or be replaced. Question is "by what"? Yes, the flags are no longer used. Most also have become irrelevant as most of the shared object stuff is now really standard. Long options all use --flag=value
, as once was the standard.
It might be wise to by default use --no-pce
and have an --pce option as that is rather rare these days (one day xpce was the reason for existence of the system 😄 )
OK, I'll do a minor update to the code and documentation. --no-pce
seems to be a good choice, although it doesn't solve the problem I reported in issue #1193
If you were to replace swipl-ld
with something else, what would that something else be? It seems that there are 3 parts:
- a
cc
orc++
wrapper - a
ld
wrapper (which would use thecc
orc++
wrapper) - a
save_program
wrapper
A replacement or replacements should probably be in a scripting language, which would make it a lot shorter and more easily modified than the existing C code.
Yes. CMake might be a viable option to deal with this. It has all the stuff to deal with the linking. The installation already creates CMake config files in <prefix>/swipl/lib/cmake
. We could extend these with CMake functions to create the saved state.
It seems that CMake has developed itself to be the de-facto standard for managing build processes.
But, just swipl-ld file.c file.pl
is rather practical for simple use cases :smile: For big projects you probably want CMake anyway. Alternatively we could rewrite it as a Prolog program. That would surely be more comfortable to manage. Once upon a time that was not possible as swipl-ld was also used during the build process, but that is now all in the hand of CMake. I needed something that could run on all platforms and writing it in C seemed more comfortable than writing it as a Microsoft .bat
file :smile: