Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swipl-ld looks for non-existent flags + some missing "help" #1195

Open
kamahen opened this issue Aug 21, 2023 · 4 comments
Open

swipl-ld looks for non-existent flags + some missing "help" #1195

kamahen opened this issue Aug 21, 2023 · 4 comments

Comments

@kamahen
Copy link
Member

kamahen commented Aug 21, 2023

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)

@JanWielemaker
Copy link
Member

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 😄 )

@kamahen
Copy link
Member Author

kamahen commented Aug 21, 2023

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

@kamahen
Copy link
Member Author

kamahen commented Aug 29, 2023

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 or c++ wrapper
  • a ld wrapper (which would use the cc or c++ 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.

@JanWielemaker
Copy link
Member

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 😄 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 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants