clang compile c executable has no @rpath on macos

Open
#2,262 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
c, macos

Research direction

No source file or test is named. Start by reproducing the generated clang commands on macOS and trace where Premake handles C executable linking, comparing it with the C++ path that already includes the rpath option. Done means C executables receive the expected @rpath linker setting and the behavior is covered by a regression test if the existing test structure permits it.

Written by the indexing model from the issue text.

Description

bug

bug

  • clang command generate executable, has no @rpath option add in linking phase, eg: -Wl,-rpath,@loader_path/.
  • system & architecture info:
    • system: mac Sequoia 15.0
    • arch: Apple M3(ARM64)

premake5 ver:

last commit info:

commit d842e671c7bc7e09f2eeaafd199fd01e48b87ee7 (HEAD -> master, origin/master, origin/HEAD)
Author: João Matos <joao@tritao.eu>
Date:   Mon Apr 29 17:08:41 2024 +0100

    Update Emscripten extension fork modules.md
    
    This just updates the URL to my fork, which is an up to date and mantained version.

premake5 generated compile command:

clang   -MD -MP -D_GLIBCXX_USE_CXX11_ABI=0 -DLUA_COMPAT_5_1 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_3  -O2 -g -Wall -Werror -Wno-strict-aliasing  -o "obj/release64/lullbc_luaexec/lua.o" -MF "obj/release64/lullbc_luaexec/lua.d" -c "../../wrap/lullbc/lua/lua.c"

additional info

If compile c++ file, will auto add -Wl,-rpath,@loader_path/. compile option when dll or exec generate

Dominant language
C
Stars
3.6k
Forks
654
Avg merge
1d 1h
Merged PRs (30d)
13

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from premake/premake-core

All issues in premake/premake-core

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.