-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[STM32F303]: build fails with gcc-12.1 #1257
Comments
This is better:
|
That was your original problem. |
On Tue, 28 Jun 2022 03:36:57 -0700 Grzegorz Szymaszek ***@***.***> wrote:
> -- Looking for sys/mman.h - not found
That was your original problem.
Exactly. It was not found because the cmake check for sys/mman.h fails
because /usr/include/features.h warns if -D_FORTIFY_SOURCE=2 is defined
without optimisation.
From build/Release/CMakeFiles/CMakeError.log:
Determining if the include file sys/mman.h exists failed with the
following output: Change Dir:
xxxx/stlink-develop/build/Release/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_92d83/fast &&
gmake[1]: Entering directory
'xxxx/stlink-develop/build/Release/CMakeFiles/CMakeTmp'
/usr/bin/gmake -f CMakeFiles/cmTC_92d83.dir/build.make
CMakeFiles/cmTC_92d83.dir/build gmake[2]: Entering directory
'xxxx/stlink-develop/build/Release/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_92d83.dir/CheckIncludeFile.c.o
/usr/bin/cc -Wall -Wextra -Wshadow -D_FORTIFY_SOURCE=2
-fstrict-aliasing -Wundef -Wformat -Wformat-security
-Wmaybe-uninitialized -Wimplicit-function-declaration -Wredundant-decls
-fPIC -Werror -std=gnu11 -o
CMakeFiles/cmTC_92d83.dir/CheckIncludeFile.c.o -c
xxxx/stlink-develop/build/Release/CMakeFiles/CMakeTmp/CheckIncludeFile.c
In file included from /usr/include/sys/mman.h:22, from
xxxx/stlink-develop/build/Release/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:
/usr/include/features.h:412:4: error: #warning _FORTIFY_SOURCE requires
compiling with optimization (-O) [-Werror=cpp] 412 | # warning
_FORTIFY_SOURCE requires compiling with optimization (-O) | ^~~~~~~
cc1: all warnings being treated as errors gmake[2]: ***
[CMakeFiles/cmTC_92d83.dir/build.make:78:
CMakeFiles/cmTC_92d83.dir/CheckIncludeFile.c.o] Error 1 gmake[2]:
Leaving directory
'xxxx/stlink-develop/build/Release/CMakeFiles/CMakeTmp'
gmake[1]: *** [Makefile:127: cmTC_92d83/fast] Error 2 gmake[1]: Leaving
directory
'xxxx/stlink-develop/build/Release/CMakeFiles/CMakeTmp'
|
I’m sorry, I wasn’t able to find the correlation between the An explicit optimization flag had been set in the past, but the relevant code was removed in #1221. |
And
And where I can find the missing packages, or who will put it back ? |
I don’t have a Fedora at hand, but I guess the package in question is glibc-devel or something like that. If it is already installed, then perhaps you are affected (#1262, for reference) by the issue described in the above comments. Please try reverting parts of #1221. |
What is the current state here? |
Hi,
See my comment:
#1257 (comment)
It appears that st-link is compiled with the default -O0 optimisation.
If you want -D_FORTIFY_SOURCE=2 then enable optimisation in
c_flags.cmake with -O. Otherwise remove -D_FORTIFY_SOURCE=2 from
c_flags.cmake.
Best regards,
Robert Jenssen
|
Further we kindly ask you to describe the detected problem as detailed as possible and to add debug output if available, by using the following template:
Command line output:
Expected/description:
The problem is that /usr/include/features.h warns if _FORTIFY_SOURCE is defined with compiler optimisation disabled:
To build successfully, I modify cmake/modules/c_flags.cmake and rebuild the Makefile:
The text was updated successfully, but these errors were encountered: