You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 2, 2019. It is now read-only.
I'm trying to debug spike and riscv-fesvr with GDB. spike by default is compiled with debug symbols (-g), which is good, but riscv-fesvr is not. On both, I also want to turn down optimization (-O0)to make tracing the code simpler. So I'm trying to figure out how to add these flags, but whatever I do is getting over-written down the line by the autoconf scripts.
I'm no expert in autotools, but I believe I should be able to do this to compile with debug symbols:
cd riscv-fesvr/build
../configure CXXFLAGS="-O0 -g"
etc...
You should also be able to pass them in via environment variables, or directly to make when you do the build (make CXXFLAGS="-O0 -g" build).
However, no matter what I do the Makefile ends up with this:
Or possibly from the Makefile.am template. I'm having a hard time figuring out which file controls the ultimate output here.
Is there another way that autoconf/automake can be used to allow the user to supply these? The automake docs has this to say:
CPPFLAGS is the user variable (see User Variables), AM_CPPFLAGS is the Automake variable
...
Automake always uses two of these variables when compiling C sources files. When compiling an object file for the mumble target, the first variable will be mumble_CPPFLAGS if it is defined, or AM_CPPFLAGS otherwise. The second variable is always CPPFLAGS.
CPPFLAGS is a user variable, i.e., a variable that users are entitled to modify in order to compile the package. This variable, like many others, is documented at the end of the output of ‘configure --help’.
...
The reason ‘$(CPPFLAGS)’ appears after ‘$(AM_CPPFLAGS)’ or ‘$(mumble_CPPFLAGS)’ in the compile command is that users should always have the last say.
(emphasis mine)
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm trying to debug spike and riscv-fesvr with GDB. spike by default is compiled with debug symbols (
-g
), which is good, but riscv-fesvr is not. On both, I also want to turn down optimization (-O0
)to make tracing the code simpler. So I'm trying to figure out how to add these flags, but whatever I do is getting over-written down the line by the autoconf scripts.I'm no expert in autotools, but I believe I should be able to do this to compile with debug symbols:
You should also be able to pass them in via environment variables, or directly to make when you do the build (
make CXXFLAGS="-O0 -g" build
).However, no matter what I do the Makefile ends up with this:
So this is going to override the -O0 level, since gcc takes the last -O it finds. (-g should stick around I guess?)
My guess is that this part of the Makefile comes from this in the configure.ac file:
Or possibly from the Makefile.am template. I'm having a hard time figuring out which file controls the ultimate output here.
Is there another way that autoconf/automake can be used to allow the user to supply these? The automake docs has this to say:
(emphasis mine)
The text was updated successfully, but these errors were encountered: