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

[22.03] tools: b43-tools: fix compilation with GCC14 #15309

Merged
merged 1 commit into from Apr 28, 2024

Conversation

BKPepe
Copy link
Member

@BKPepe BKPepe commented Apr 28, 2024

Backported from #15012

Fixes:

make[3]: Entering directory '/Volumes/OpenWrt/omnia-hbl/build/build_dir/host/b43-tools/assembler'
     DEPEND   dep/args.d
     DEPEND   dep/initvals.d
     DEPEND   dep/main.d
     DEPEND   dep/parser.d
     DEPEND   dep/scanner.d
     DEPEND   dep/util.d
: -O2 -I/Volumes/OpenWrt/omnia-hbl/build/staging_dir/host/include  -include endian.h -D__transparent_union__=__unused__ -D_STRING_ARCH_unaligned=1 -D__builtin_stpcpy=stpcpy args.c
     CC       obj/args.o
: -O2 -I/Volumes/OpenWrt/omnia-hbl/build/staging_dir/host/include  -include endian.h -D__transparent_union__=__unused__ -D_STRING_ARCH_unaligned=1 -D__builtin_stpcpy=stpcpy initvals.c
     CC       obj/initvals.o
: -O2 -I/Volumes/OpenWrt/omnia-hbl/build/staging_dir/host/include  -include endian.h -D__transparent_union__=__unused__ -D_STRING_ARCH_unaligned=1 -D__builtin_stpcpy=stpcpy main.c
     CC       obj/main.o
: -O2 -I/Volumes/OpenWrt/omnia-hbl/build/staging_dir/host/include  -include endian.h -D__transparent_union__=__unused__ -D_STRING_ARCH_unaligned=1 -D__builtin_stpcpy=stpcpy parser.c
     CC       obj/parser.o
parser.y:58:21: error: incompatible integer to pointer conversion initializing 'struct statement *' with an expression of type 'YYSTYPE' (aka 'int') [-Wint-conversion]
                struct statement *s = yyvsp[-1];
                                  ^   ~~~~~~~~~
parser.y:69:22: error: incompatible integer to pointer conversion initializing 'struct initval_op *' with an expression of type 'YYSTYPE' (aka 'int') [-Wint-conversion]
                struct initval_op *io = yyvsp[-1];
                                   ^    ~~~~~~~~~
parser.y:87:16: error: incompatible integer to pointer conversion initializing 'const char *' with an expression of type 'YYSTYPE' (aka 'int') [-Wint-conversion]
                        const char *sectname = yyvsp[-1];
                                    ^          ~~~~~~~~~
parser.y:113:10: error: incompatible pointer to integer conversion assigning to 'YYSTYPE' (aka 'int') from 'struct initval_op *' [-Wint-conversion]
                        yyval = iop;
                              ^ ~~~
parser.y:120:10: error: incompatible pointer to integer conversion assigning to 'YYSTYPE' (aka 'int') from 'struct initval_op *' [-Wint-conversion]
                        yyval = iop;
                              ^ ~~~
parser.y:127:10: error: incompatible pointer to integer conversion assigning to 'YYSTYPE' (aka 'int') from 'struct initval_op *' [-Wint-conversion]
                        yyval = iop;
                              ^ ~~~
parser.y:134:10: error: incompatible pointer to integer conversion assigning to 'YYSTYPE' (aka 'int') from 'struct initval_op *' [-Wint-conversion]
                        yyval = iop;
                              ^ ~~~
parser.y:142:10: error: incompatible pointer to integer conversion assigning to 'YYSTYPE' (aka 'int') from 'struct initval_op *' [-Wint-conversion]
                        yyval = iop;
                              ^ ~~~
parser.y:150:10: error: incompatible pointer to integer conversion assigning to 'YYSTYPE' (aka 'int') from 'struct initval_op *' [-Wint-conversion]
                        yyval = iop;
                              ^ ~~~
parser.y:157:10: error: incompatible pointer to integer conversion assigning to 'YYSTYPE' (aka 'int') from 'struct initval_op *' [-Wint-conversion]
                        yyval = iop;
                              ^ ~~~
parser.y:162:19: error: incompatible integer to pointer conversion initializing 'struct asmdir *' with an expression of type 'YYSTYPE' (aka 'int') [-Wint-conversion]
                        struct asmdir *ad = yyvsp[0];
                                       ^    ~~~~~~~~
parser.y:167:17: error: incompatible integer to pointer conversion assigning to 'struct asmdir *' from 'YYSTYPE' (aka 'int') [-Wint-conversion]
                                s->u.asmdir = yyvsp[0];
                                            ^ ~~~~~~~~
parser.y:168:11: error: incompatible pointer to integer conversion assigning to 'YYSTYPE' (aka 'int') from 'struct statement *' [-Wint-conversion]
                                yyval = s;
                                      ^ ~
parser.y:170:11: error: incompatible pointer to integer conversion assigning to 'YYSTYPE' (aka 'int') from 'void *' [-Wint-conversion]
                                yyval = NULL;
                                      ^ ~~~~
parser.y:176:15: error: incompatible integer to pointer conversion assigning to 'struct label *' from 'YYSTYPE' (aka 'int') [-Wint-conversion]
                        s->u.label = yyvsp[0];
                                   ^ ~~~~~~~~
parser.y:177:10: error: incompatible pointer to integer conversion assigning to 'YYSTYPE' (aka 'int') from 'struct statement *' [-Wint-conversion]
                        yyval = s;
                              ^ ~
parser.y:183:14: error: incompatible integer to pointer conversion assigning to 'struct instruction *' from 'YYSTYPE' (aka 'int') [-Wint-conversion]
                        s->u.insn = yyvsp[0];
                                  ^ ~~~~~~~~
parser.y:184:10: error: incompatible pointer to integer conversion assigning to 'YYSTYPE' (aka 'int') from 'struct statement *' [-Wint-conversion]
                        yyval = s;
                              ^ ~
parser.y:190:14: error: incompatible integer to pointer conversion assigning to 'struct instruction *' from 'YYSTYPE' (aka 'int') [-Wint-conversion]
                        s->u.insn = yyvsp[0];
                                  ^ ~~~~~~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[3]: *** [Makefile:53: obj/parser.o] Error 1
make[3]: Leaving directory '/Volumes/OpenWrt/omnia-hbl/build/build_dir/host/b43-tools/assembler'
make[2]: *** [Makefile:52: /Volumes/OpenWrt/omnia-hbl/build/build_dir/host/b43-tools/.built] Error 2
make[2]: Leaving directory '/Volumes/OpenWrt/omnia-hbl/build/tools/b43-tools'
time: tools/b43-tools/compile#0.81#0.36#1.86
    ERROR: tools/b43-tools failed to build.

Reproduced on MacOS, Intel, version 14.4.1

cc: @robimarko

The fix is already in OpenWrt 23.05, so only 22.03 is left. So many issues with almost deprecated 22.03 branch, though.

@github-actions github-actions bot added build/scripts/tools pull request/issues for build, scripts and tools related changes release/22.03 pull request/issue targeted (also) for OpenWrt 22.03 release labels Apr 28, 2024
@robimarko
Copy link
Contributor

22.03 wont compile on current macOS, I got as far as gdb and then it fails again, I dont know how much sense it makes to put any more effort into it

@BKPepe
Copy link
Member Author

BKPepe commented Apr 28, 2024

Me neither, though. Luckily I found some old build_dir for OpenWrt 22.03 and that at least works for me.

GCC14 no longer treats integer types and pointer types as equivalent in
assignments (including implied assignments of function arguments and return
values), and instead fails the compilation with a type error.

So, as a workaround lets disable the newly introduced error
-Werror=int-conversion and just make it print a warning to enable compiling
with GCC14 as Fedora 40 now defaults to it.

(cherry picked from commit 0c96d20)
Link: openwrt#15309
Signed-off-by: Robert Marko <robimarko@gmail.com>
@openwrt-bot openwrt-bot merged commit 5f07510 into openwrt:openwrt-22.03 Apr 28, 2024
3 checks passed
@robimarko
Copy link
Contributor

Thanks! Rebased on top of openwrt-22.03 and merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build/scripts/tools pull request/issues for build, scripts and tools related changes release/22.03 pull request/issue targeted (also) for OpenWrt 22.03 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants