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

Please support overriding ld/pkg-config commands #359

Open
nya3jp opened this issue Jul 5, 2023 · 0 comments · May be fixed by #361
Open

Please support overriding ld/pkg-config commands #359

nya3jp opened this issue Jul 5, 2023 · 0 comments · May be fixed by #361
Assignees
Milestone

Comments

@nya3jp
Copy link

nya3jp commented Jul 5, 2023

I'd like to build proot with prefixed toolchains, and it requires allowing to override commands with Make variables. Currently many commands are overridable, but there are two exceptions: ld and pkg-config.

ld is hard-coded here:

BUILD_ID_NONE := $(shell if ld --build-id=none --version >/dev/null 2>&1; then echo ',--build-id=none'; fi)

https://github.com/proot-me/proot/blob/master/src/GNUmakefile#L162

pkg-config is hard-coded here:

CFLAGS   += -g -Wall -Wextra -O2
CFLAGS   += $(shell pkg-config --cflags talloc)
LDFLAGS  += -Wl,-z,noexecstack
LDFLAGS  += $(shell pkg-config --libs talloc)

https://github.com/proot-me/proot/blob/master/src/GNUmakefile#L25

nya3jp added a commit to nya3jp/proot that referenced this issue Jul 5, 2023
nya3jp added a commit to nya3jp/proot that referenced this issue Jul 5, 2023
This patch adds new make variables, LD_CMD and PKG_CONFIG, to allow
overriding command invocations when using prefixed toolchains. Usually
it is enough to set CROSS_COMPILE though.

Fixes proot-me#359.
@nya3jp nya3jp linked a pull request Jul 5, 2023 that will close this issue
nya3jp added a commit to nya3jp/gentoo that referenced this issue Jul 5, 2023
proot's makefile doesn't support overriding ld/pkg-config command
invocations, so patch it. An upstream patch has been sent:
proot-me/proot#359

proot doesn't link with LLVM ld, so force to use GNU ld.
proot-me/proot#360
nya3jp added a commit to nya3jp/gentoo that referenced this issue Jul 5, 2023
proot's makefile doesn't support overriding ld/pkg-config command
invocations, so patch it. An upstream patch has been sent:
proot-me/proot#359

proot doesn't link with LLVM ld, so force to use GNU ld.
proot-me/proot#360

Signed-off-by: Shuhei Takahashi <[email protected]>
@oxr463 oxr463 added this to the PRoot v5.5.0 milestone Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants