Comments (6)
Thanks. Applying this modification seems to work for GCC 10.
I moved to GCC 12 and it works as well.
from autokernel.
Hi, thanks for the report! I could successfully build the bridge for your given tar.gz both on NixOS and in a Archlinux WSL. So this probably means that you are using a nonstandard compiler or something else which I didn't anticipate.
<command-line>: error: parameter name omitted
This seems like the root problem, and hints at your compiler (or another invoked utility) expecting different arguments. To solve this, I'd need more info about your system. Could you maybe post your gcc, make and awk version?
Other than that it might be helpful to output the commands that are invoked to compile the bridge, which you can do by modifying src/bridge/cbridge/interceptor.sh
to print the compilation command:
diff --git a/src/bridge/cbridge/interceptor.sh b/src/bridge/cbridge/interceptor.sh
index 953ccf4..a185834 100644
--- a/src/bridge/cbridge/interceptor.sh
+++ b/src/bridge/cbridge/interceptor.sh
@@ -41,6 +41,12 @@ function build_bridge() {
o="scripts/kconfig/$i.autokernel.o"
o_files+=("$o")
+ echo gcc -O3 -fPIC -Wp,-MMD,scripts/kconfig/."$i".o.d \
+ -Wall -fomit-frame-pointer \
+ -std="$std" \
+ $getenv_override \
+ "-DMESSAGE_CALLBACK_TYPE=$message_callback_type" \
+ -I ./scripts/kconfig -c -o "$o" scripts/kconfig/"$i".c >&2
gcc -O3 -fPIC -Wp,-MMD,scripts/kconfig/."$i".o.d \
-Wall -fomit-frame-pointer \
-std="$std" \
from autokernel.
- About the versions:
~/Documents/playground/autokernel (main u=)$ gcc --version
gcc (Gentoo 10.3.0-r2 p3) 10.3.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
~/Documents/playground/autokernel (main u=)$ awk --version
GNU Awk 5.2.1, API 3.2
Copyright (C) 1989, 1991-2022 Free Software Foundation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/.
~/Documents/playground/autokernel (main u=)$ make --version
GNU Make 4.3
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
- The output with the patch applied to
src/bridge/cbridge/interceptor.sh
:
~/Documents/playground/autokernel (main u=)$ ./target/debug/autokernel -c examples/myconfig.toml -k linux-5.13 build
gcc -O3 -fPIC -Wp,-MMD,scripts/kconfig/.confdata.o.d -Wall -fomit-frame-pointer -std=gnu89 -Dgetenv=autokernel_getenv -DMESSAGE_CALLBACK_TYPE=const char* -I ./scripts/kconfig -c -o scripts/kconfig/confdata.autokernel.o scripts/kconfig/confdata.c
gcc -O3 -fPIC -Wp,-MMD,scripts/kconfig/.expr.o.d -Wall -fomit-frame-pointer -std=gnu89 -Dgetenv=autokernel_getenv -DMESSAGE_CALLBACK_TYPE=const char* -I ./scripts/kconfig -c -o scripts/kconfig/expr.autokernel.o scripts/kconfig/expr.c
gcc -O3 -fPIC -Wp,-MMD,scripts/kconfig/.lexer.lex.o.d -Wall -fomit-frame-pointer -std=gnu89 -Dgetenv=autokernel_getenv -DMESSAGE_CALLBACK_TYPE=const char* -I ./scripts/kconfig -c -o scripts/kconfig/lexer.lex.autokernel.o scripts/kconfig/lexer.lex.c
gcc -O3 -fPIC -Wp,-MMD,scripts/kconfig/.menu.o.d -Wall -fomit-frame-pointer -std=gnu89 -Dgetenv=autokernel_getenv -DMESSAGE_CALLBACK_TYPE=const char* -I ./scripts/kconfig -c -o scripts/kconfig/menu.autokernel.o scripts/kconfig/menu.c
gcc -O3 -fPIC -Wp,-MMD,scripts/kconfig/.parser.tab.o.d -Wall -fomit-frame-pointer -std=gnu89 -Dgetenv=autokernel_getenv -DMESSAGE_CALLBACK_TYPE=const char* -I ./scripts/kconfig -c -o scripts/kconfig/parser.tab.autokernel.o scripts/kconfig/parser.tab.c
gcc -O3 -fPIC -Wp,-MMD,scripts/kconfig/.preprocess.o.d -Wall -fomit-frame-pointer -std=gnu89 -Dgetenv=autokernel_getenv -DMESSAGE_CALLBACK_TYPE=const char* -I ./scripts/kconfig -c -o scripts/kconfig/preprocess.autokernel.o scripts/kconfig/preprocess.c
gcc -O3 -fPIC -Wp,-MMD,scripts/kconfig/.symbol.o.d -Wall -fomit-frame-pointer -std=gnu89 -Dgetenv=autokernel_getenv -DMESSAGE_CALLBACK_TYPE=const char* -I ./scripts/kconfig -c -o scripts/kconfig/symbol.autokernel.o scripts/kconfig/symbol.c
gcc -O3 -fPIC -Wp,-MMD,scripts/kconfig/.util.o.d -Wall -fomit-frame-pointer -std=gnu89 -Dgetenv=autokernel_getenv -DMESSAGE_CALLBACK_TYPE=const char* -I ./scripts/kconfig -c -o scripts/kconfig/util.autokernel.o scripts/kconfig/util.c
gcc -O3 -fPIC -Wp,-MMD,scripts/kconfig/.autokernel_bridge.o.d -Wall -fomit-frame-pointer -std=gnu11 -DMESSAGE_CALLBACK_TYPE=const char* -I ./scripts/kconfig -c -o scripts/kconfig/autokernel_bridge.autokernel.o scripts/kconfig/autokernel_bridge.c
scripts/kconfig/autokernel_bridge.c: In function ‘dev_null_message_callback’:
<command-line>: error: parameter name omitted
scripts/kconfig/autokernel_bridge.c:24:39: note: in expansion of macro ‘MESSAGE_CALLBACK_TYPE’
24 | static void dev_null_message_callback(MESSAGE_CALLBACK_TYPE) {}
| ^~~~~~~~~~~~~~~~~~~~~
scripts/kconfig/autokernel_bridge.c: In function ‘init’:
scripts/kconfig/autokernel_bridge.c:80:2: warning: ignoring return value of ‘getcwd’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
80 | getcwd(saved_working_directory, 2048);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: Failed to compile autokernel_bridge for autokernel bridge!
make[1]: *** [scripts/kconfig/Makefile:87: defconfig] Error 1
make: *** [Makefile:614: defconfig] Error 2
error: Could not prepare bridge in linux-5.13
because: Condition failed: `builder_output.status.success()`
from autokernel.
Looking at the GCC invocation it looks like the value of -DMESSAGE_CALLBACK_TYPE=const char*
needs to be quoted:
diff --git a/src/bridge/cbridge/interceptor.sh b/src/bridge/cbridge/interceptor.sh
index 0be66c9..e32ba6f 100644
--- a/src/bridge/cbridge/interceptor.sh
+++ b/src/bridge/cbridge/interceptor.sh
@@ -45,7 +45,7 @@ function build_bridge() {
-Wall -fomit-frame-pointer \
-std="$std" \
$getenv_override \
- "-DMESSAGE_CALLBACK_TYPE=$message_callback_type" \
+ "-DMESSAGE_CALLBACK_TYPE=\"$message_callback_type\"" \
-I ./scripts/kconfig -c -o "$o" scripts/kconfig/"$i".c \
|| die "Failed to compile $i for autokernel bridge!"
done
Now, the error message has changed:
<command-line>: error: expected declaration specifiers or ‘...’ before string constant
<command-line>: note: in definition of macro ‘MESSAGE_CALLBACK_TYPE’
scripts/kconfig/autokernel_bridge.c: In function ‘init’:
scripts/kconfig/autokernel_bridge.c:72:28: error: ‘dev_null_message_callback’ undeclared (first use in this function); did you mean ‘conf_set_message_callback’?
72 | conf_set_message_callback(dev_null_message_callback);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
| conf_set_message_callback
scripts/kconfig/autokernel_bridge.c:72:28: note: each undeclared identifier is reported only once for each function it appears in
scripts/kconfig/autokernel_bridge.c:80:2: warning: ignoring return value of ‘getcwd’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
80 | getcwd(saved_working_directory, 2048);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: Failed to compile autokernel_bridge for autokernel bridge!
make[1]: *** [scripts/kconfig/Makefile:87: defconfig] Error 1
make: *** [Makefile:614: defconfig] Error 2
error: Could not prepare bridge in linux-5.13
because: Condition failed: `builder_output.status.success()`
from autokernel.
Looking at the GCC invocation it looks like the value of
-DMESSAGE_CALLBACK_TYPE=const char*
needs to be quoted:
No, it already is quoted correctly. The quotes are just lost in the echo output since in echo "a b"
they get interpreted by the shell and show a b
. Your change would add additional quotes to the source code definition of the callback, which is not what we want.
Notice how only the last invocation of gcc fails:
<command-line>: error: expected declaration specifiers or ‘...’ before string constant
<command-line>: note: in definition of macro ‘MESSAGE_CALLBACK_TYPE’
This is the problem. I'm not sure whether it is because you are using a old gcc from 2020 or whether it is something else, but what I can deduct from this is that for some reason your compiler doesn't like the syntax void some_func(char*);
without naming the parameter. Please try the following patch:
diff --git a/src/bridge/cbridge/interceptor.sh b/src/bridge/cbridge/interceptor.sh
index 953ccf4..0cca8b2 100644
--- a/src/bridge/cbridge/interceptor.sh
+++ b/src/bridge/cbridge/interceptor.sh
@@ -26,9 +26,9 @@ function build_bridge() {
INPUTS=(conf zconf.tab autokernel_bridge)
fi
if grep -q "set_message_callback.*va" scripts/kconfig/lkc_proto.h; then
- message_callback_type="const char*, va_list"
+ message_callback_type="const char* _a, va_list _b"
else
- message_callback_type="const char*"
+ message_callback_type="const char* _a"
fi
for i in "${INPUTS[@]}"; do
if [[ "$i" == autokernel_bridge ]]; then
from autokernel.
Great, then I'll change that upstream too
from autokernel.
Related Issues (8)
- KConfigLib is broken for kernels newer than 5.12.1 (at least) HOT 3
- UnsupportedConstituents error is not helpful HOT 2
- No-op reassignments shouldn't warn HOT 1
- Usage in NixOS HOT 5
- "Missing file extension" for ".config" HOT 1
- Does not work with older kernels HOT 1
- How to encode names starting with numerals in Lua? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autokernel.