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

-Werror causing build issues #78

Open
ceneblock opened this issue Jan 25, 2018 · 5 comments
Open

-Werror causing build issues #78

ceneblock opened this issue Jan 25, 2018 · 5 comments

Comments

@ceneblock
Copy link

I'm trying to build on OpenSuse and the -Werror set in the make files causes build issues. For example:

propgcc/binutils/bfd/coffgen.c:2029:8:

warning: this statement may fall through [-Wimplicit-fallthrough=]
if (combined->u.syment.n_type == T_NULL)
^
/home/cen5848/dev/propgcc/binutils/bfd/coffgen.c:2046:3: note: here
case C_EXT:
^~~~
/home/cen5848/dev/propgcc/binutils/bfd/coffgen.c:2048:8: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (ISFCN (combined->u.syment.n_type))
^
/home/cen5848/dev/propgcc/binutils/bfd/coffgen.c:2066:3: note: here
default:
^~~~~~~

If you read the comments for those files, then you can see that the fallthrough is expected.

This is in some other code like gprof and gas. Removing the -Werror fixes the problem.

Likewise there was a similar problem bfd's doc building.

If there is any additional information that I can provide, then please let me know.

Helpful information:
uname -a:

Linux computer 4.14.12-1-default #1 SMP PREEMPT Fri Jan 5 18:15:55 UTC 2018 (3cf399e) x86_64 x86_64 x86_64 GNU/Linux

gcc -v:

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/7/lto-wrapper
OFFLOAD_TARGET_NAMES=hsa:nvptx-none
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,ada,go --enable-offload-targets=hsa,nvptx-none=/usr/nvptx-none, --without-cuda-driver --enable-checking=release --disable-werror --with-gxx-include-dir=/usr/include/c++/7 --enable-ssp --disable-libssp --disable-libvtv --disable-libcc1 --enable-plugin --with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --with-slibdir=/lib64 --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-version-specific-runtime-libs --with-gcc-major-version-only --enable-linker-build-id --enable-linux-futex --enable-gnu-indirect-function --program-suffix=-7 --without-system-libunwind --enable-multilib --with-arch-32=x86-64 --with-tune=generic --build=x86_64-suse-linux --host=x86_64-suse-linux
Thread model: posix
gcc version 7.2.1 20171020 [gcc-7-branch revision 253932] (SUSE Linux)

@ceneblock
Copy link
Author

It seems that in the propgcc/binutils/bfd/Makefile.in -Werror is supposed to be turned off, but I don't know if that rule is being skipped or not.

Here is a full error from objdump:

gcc -DHAVE_CONFIG_H -I. -I/tmp/propgcc/binutils/binutils -I. -I/tmp/propgcc/binutils/binutils -I../bfd -I/tmp/propgcc/binutils/binutils/../bfd -I/tmp/propgcc/binutils/binutils/../include -DLOCALEDIR=""/opt/parallax/share/locale"" -Dbin_dummy_emulation=bin_vanilla_emulation -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT size.o -MD -MP -MF .deps/size.Tpo -c -o size.o /tmp/propgcc/binutils/binutils/size.c
mv -f .deps/size.Tpo .deps/size.Po
gcc -DHAVE_CONFIG_H -I. -I/tmp/propgcc/binutils/binutils -I. -I/tmp/propgcc/binutils/binutils -I../bfd -I/tmp/propgcc/binutils/binutils/../bfd -I/tmp/propgcc/binutils/binutils/../include -DLOCALEDIR=""/opt/parallax/share/locale"" -Dbin_dummy_emulation=bin_vanilla_emulation -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT bucomm.o -MD -MP -MF .deps/bucomm.Tpo -c -o bucomm.o /tmp/propgcc/binutils/binutils/bucomm.c
mv -f .deps/bucomm.Tpo .deps/bucomm.Po
gcc -DHAVE_CONFIG_H -I. -I/tmp/propgcc/binutils/binutils -I. -I/tmp/propgcc/binutils/binutils -I../bfd -I/tmp/propgcc/binutils/binutils/../bfd -I/tmp/propgcc/binutils/binutils/../include -DLOCALEDIR=""/opt/parallax/share/locale"" -Dbin_dummy_emulation=bin_vanilla_emulation -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT version.o -MD -MP -MF .deps/version.Tpo -c -o version.o /tmp/propgcc/binutils/binutils/version.c
mv -f .deps/version.Tpo .deps/version.Po
gcc -DHAVE_CONFIG_H -I. -I/tmp/propgcc/binutils/binutils -I. -I/tmp/propgcc/binutils/binutils -I../bfd -I/tmp/propgcc/binutils/binutils/../bfd -I/tmp/propgcc/binutils/binutils/../include -DLOCALEDIR=""/opt/parallax/share/locale"" -Dbin_dummy_emulation=bin_vanilla_emulation -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT filemode.o -MD -MP -MF .deps/filemode.Tpo -c -o filemode.o /tmp/propgcc/binutils/binutils/filemode.c
mv -f .deps/filemode.Tpo .deps/filemode.Po
/bin/sh ./libtool --tag=CC --mode=link gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -o size size.o bucomm.o version.o filemode.o ../bfd/libbfd.la ../libiberty/libiberty.a -lz
libtool: link: gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -o size size.o bucomm.o version.o filemode.o ../bfd/.libs/libbfd.a ../libiberty/libiberty.a -lz
gcc -DHAVE_CONFIG_H -I. -I/tmp/propgcc/binutils/binutils -I. -I/tmp/propgcc/binutils/binutils -I../bfd -I/tmp/propgcc/binutils/binutils/../bfd -I/tmp/propgcc/binutils/binutils/../include -DLOCALEDIR=""/opt/parallax/share/locale"" -Dbin_dummy_emulation=bin_vanilla_emulation -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT objdump.o -MD -MP -MF .deps/objdump.Tpo -c -o objdump.o -DOBJDUMP_PRIVATE_VECTORS="" /tmp/propgcc/binutils/binutils/objdump.c
/tmp/propgcc/binutils/binutils/objdump.c: In function ‘main’:
/tmp/propgcc/binutils/binutils/objdump.c:3663:13: error: this statement may fall through [-Werror=implicit-fallthrough=]
seenflag = TRUE;
/tmp/propgcc/binutils/binutils/objdump.c:3664:2: note: here
case 'v':
^~~~
cc1: all warnings being treated as errors
make[5]: *** [Makefile:1256: objdump.o] Error 1
make[5]: Leaving directory '/tmp/build/binutils/binutils'
make[4]: *** [Makefile:934: all-recursive] Error 1
make[4]: Leaving directory '/tmp/build/binutils/binutils'
make[3]: *** [Makefile:593: all] Error 2
make[3]: Leaving directory '/tmp/build/binutils/binutils'
make[2]: *** [Makefile:3387: all-binutils] Error 2
make[2]: Leaving directory '/tmp/build/binutils'
make[1]: *** [Makefile:838: all] Error 2
make[1]: Leaving directory '/tmp/build/binutils'
make: *** [Makefile:163: /tmp/propgcc/../build/binutils/binutils-built] Error 2

@victorOle
Copy link

victorOle commented Nov 8, 2020

Problem still persists. Had to make some horrible hacks to get it compile with gcc-7.5.0. Can any fix be expected?

0001-COMP-hack-to-remove-Werror-for-newer-gcc.patch.txt

@stu
Copy link

stu commented Apr 30, 2021

CFLAGS="-Wno-error" CXXFLAGS="-Wno-error" CC=gcc CXX=g++ make

-Wno-error should override -Werror

because the gcc is so old i'm now running into stupid texinfo errors because you cant NOT build the dang gcc documentation and texinfo is too updated I guess.

@drawkula
Copy link

drawkula commented Apr 30, 2021

Build the needed prehistoric TexInfo with e.g. --prefix=/opt/permian-toolkit and put /opt/permian-toolkit/bin in front of your PATH while building PropGCC.

@brvtalcake
Copy link

@drawkula when I try to manually make the problematic as.info :

/opt/permian-toolkit/bin/makeinfo: unrecognized option '--split-size=5000000'

(with version 4.0)

makeinfo version 4.5 gives :

Too many errors!  Gave up.
Too many errors!  Gave up.
Too many errors!  Gave up.
Too many errors!  Gave up.
Too many errors!  Gave up.
Too many errors!  Gave up.
Too many errors!  Gave up.
...
...
Too many errors!  Gave up.
Segmentation fault (core dumped)

I guess I have to try a fifth makeinfo version before success (or use another compiler since I'm already too tired of this)

BTW, I don't know if this is expected, but aliasing makeinfo to /opt/permian-toolkit/bin/makeinfo still uses the one in /usr/bin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants