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

Weird dæmon compiler string transformation when compiler has linux in its name #1551

Open
illwieckz opened this issue Feb 12, 2025 · 4 comments

Comments

@illwieckz
Copy link
Member

illwieckz commented Feb 12, 2025

The compilation command line does -DDAEMON_CXX_COMPILER_STRING=GCC_12.2.0:arm-linux-gnueabihf-g++ but the engine is printing this:

Unvanquished 0.55.2 Linux armhf (GCC_12.2.0:arm-1-gnueabihf-g++) Feb 12 2025

See how arm-linux-gnueabihf-g++ is transformed into arm-1-gnueabihf-g++.

I don't know what's happening there.

@illwieckz
Copy link
Member Author

illwieckz commented Feb 12, 2025

$ echo '' | arm-linux-gnueabihf-g++ -dM -E - | grep linux
#define __linux 1
#define __gnu_linux__ 1
#define linux 1
#define __linux__ 1

So, the compiler sets some linux definition to 1, but then, how can a definition be expanded within another definition?

@illwieckz illwieckz changed the title Weird dæmon compiler string transformation on armhf Weird dæmon compiler string transformation when compiler has linux in its name Feb 12, 2025
@illwieckz
Copy link
Member Author

illwieckz commented Feb 12, 2025

Well, this is likely affecting any compiler having linux in its name:

Unvanquished 0.55.2 Linux arm64 (GCC_12.2.0:aarch64-1-gnu-g++) Feb 12 2025
Unvanquished 0.55.2 Linux amd64 (GCC_13.3.0:x86_64-1-gnu-g++) Feb 12 2025

@slipher
Copy link
Member

slipher commented Feb 12, 2025

As seen in #1497 it is risky to pass aribitrary data through command-line defines. Should generate a file like the GLSL embedded data

@illwieckz
Copy link
Member Author

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

No branches or pull requests

2 participants