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

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 <nya@chromium.org>
@oxr463 oxr463 added this to the PRoot v5.5.0 milestone Jul 5, 2023
@oxr463 oxr463 added this to Needs triage in Triage via automation Jul 5, 2023
@oxr463 oxr463 added this to To do in PRoot via automation Jul 5, 2023
@oxr463 oxr463 moved this from To do to Needs review in PRoot Jul 5, 2023
@oxr463 oxr463 moved this from Needs triage to Low priority in Triage Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
PRoot
Needs review
Triage
Low priority
Development

Successfully merging a pull request may close this issue.

2 participants