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

Lots of new compiler warnings: unknown warning option '-Wtrampolines' [-Wunknown-warning-option] #121026

Closed
sobolevn opened this issue Jun 26, 2024 · 7 comments
Assignees
Labels
build The build process and cross-build OS-mac type-bug An unexpected behavior, bug, or error

Comments

@sobolevn
Copy link
Member

sobolevn commented Jun 26, 2024

Bug report

I am building CPython on macos 14.5, m2 chip, gcc:

» gcc --version
Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: arm64-apple-darwin23.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

I have lots of warnings like

gcc  -fno-strict-overflow -Wimplicit-fallthrough -fstack-protector-strong -Wtrampolines -Wsign-compare -g -Og -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include  -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I./Include/internal -I./Include/internal/mimalloc  -I. -I./Include -I/opt/homebrew/opt/openssl/include -I/opt/homebrew/opt/openssl/include   -c ./Modules/_testmultiphase.c -o Modules/_testmultiphase.o
gcc  -fno-strict-overflow -Wimplicit-fallthrough -fstack-protector-strong -Wtrampolines -Wsign-compare -g -Og -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include  -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I./Include/internal -I./Include/internal/mimalloc  -I. -I./Include -I/opt/homebrew/opt/openssl/include -I/opt/homebrew/opt/openssl/include   -c ./Modules/_testsinglephase.c -o Modules/_testsinglephase.o
warning: unknown warning option '-Wtrampolines' [-Wunknown-warning-option]
warning: unknown warning option '-Wtrampolines' [-Wunknown-warning-option]
warning: unknown warning option '-Wtrampolines' [-Wunknown-warning-option]
1 warning generated.
1 warning generated.
warning: unknown warning option '-Wtrampolines' [-Wunknown-warning-option]
gcc  -fno-strict-overflow -Wimplicit-fallthrough -fstack-protector-strong -Wtrampolines -Wsign-compare -g -Og -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include  -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I./Include/internal -I./Include/internal/mimalloc  -I. -I./Include -I/opt/homebrew/opt/openssl/include -I/opt/homebrew/opt/openssl/include   -c ./Modules/_testexternalinspection.c -o Modules/_testexternalinspection.o
gcc  -fno-strict-overflow -Wimplicit-fallthrough -fstack-protector-strong -Wtrampolines -Wsign-compare -g -Og -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include  -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I./Include/internal -I./Include/internal/mimalloc  -I. -I./Include -I/opt/homebrew/opt/openssl/include -I/opt/homebrew/opt/openssl/include   -c ./Modules/_ctypes/_ctypes_test.c -o Modules/_ctypes/_ctypes_test.o
warning: unknown warning option '-Wtrampolines' [-Wunknown-warning-option]
warning: unknown warning option '-Wtrampolines' [-Wunknown-warning-option]
1 warning generated.
1 warning generated.

Things I've tried:

  • Clean build with make clean
  • Latest main

Looks like #120975 is the cause.
Please, note that buildbots of m1 workers also failed on this PR.

CC @nohlson @corona10

Linked PRs

@sobolevn sobolevn added type-bug An unexpected behavior, bug, or error OS-mac build The build process and cross-build labels Jun 26, 2024
@hugovk hugovk changed the title Lots of new copiler warnings: unknown warning option '-Wtrampolines' [-Wunknown-warning-option] Lots of new compiler warnings: unknown warning option '-Wtrampolines' [-Wunknown-warning-option] Jun 26, 2024
@corona10
Copy link
Member

ah this is because apple gcc is alias of clang, we should exclude macOS case. I will submit the patch today.

@nohlson
Copy link
Contributor

nohlson commented Jun 26, 2024

ah this is because apple gcc is alias of clang, we should exclude macOS case. I will submit the patch today.

I was wondering if simply using the fourth argument of AX_CHECK_COMPILE_FLAG to include -Werror would be a better solution than making the special case for apple gcc. That way any system compiling with clang would not include -Wtrampolines and could remove the check for $CC that wraps it:

AX_CHECK_COMPILE_FLAG([-Wtrampolines], [BASECFLAGS="$BASECFLAGS -Wtrampolines"], [AC_MSG_WARN([-Wtrampolines not supported])], [-Werror])

@mokko
Copy link

mokko commented Jun 26, 2024

Related commit?

7fb32e0

@corona10
Copy link
Member

@nohlson You can submit the patch if you want!

@nohlson
Copy link
Contributor

nohlson commented Jun 26, 2024

@corona10 I will submit a patch that makes all these additions to BASEFLAGS include -Werror when checking for each flag.

@corona10
Copy link
Member

@nohlson Please ping me once you submit the patch, we should run build bot too :)

@nohlson
Copy link
Contributor

nohlson commented Jun 26, 2024

@corona10 new PR #121030

mrahtz pushed a commit to mrahtz/cpython that referenced this issue Jun 30, 2024
noahbkim pushed a commit to hudson-trading/cpython that referenced this issue Jul 11, 2024
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build OS-mac type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

5 participants
@mokko @sobolevn @corona10 @nohlson and others