Skip to content
This repository has been archived by the owner on Apr 4, 2022. It is now read-only.

pstore-import into existing database #106

Open
paulhuggett opened this issue Aug 9, 2021 · 1 comment
Open

pstore-import into existing database #106

paulhuggett opened this issue Aug 9, 2021 · 1 comment

Comments

@paulhuggett
Copy link
Contributor

paulhuggett commented Aug 9, 2021

At the time of writing, rld is missing some important features such as support for static archives and support for external databases. This means that using the standard libraries is awkward and clumsy. It’s necessary to export the library database and import it into the local database so that all of the inputs comes from the same place.

This awkwardness is exacerbated because pstore-import can’t import into an existing database. I didn’t want to implement any extra features in that tool that weren’t genuinely useful and important.

I want to be able to write a makefile such as:

all: a.out

musl-prepo.ph: /musl/lib/musl-prepo.json
	pstore-import clang.db $<
	echo $< > $@

a.out: main.o musl-prepo.ph
	rld -o a.out main.o $(LIBC)

However, right now I have to guarantee that the import will always happen before the compiler runs — even when building in parallel — to avoid the possibility of pstore-import failing because the database exists. This forces use of recursive make, piling more nasties on top of an already warty kludge:

all:
	$(MAKE) clang.db
	$(MAKE) a.out

clang.db: /musl/lib/musl-prepo.json
	-rm -f $@
	pstore-import $@ $<

a.out: main.o
	rld -o $@ $^ $(LIBC)
@paulhuggett
Copy link
Contributor Author

Note that rld now does have support for static archives. Using standard libraries remains awkward for the moment, but this will be resolved by having rld ”auto-merge” the required data. I’m not sure that a use-case for this feature still exists…

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

No branches or pull requests

1 participant