When building gdb with gcc-6.0.0-0.15.fc24 on s390x I'm getting "strict aliasing" warnings/errors. The warning/error doesn't appear when built with gcc-6.0.0-0.14.fc24. Filed against gdb to see whether it is a real bug before switching to gcc. from build.log ... libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../bfd -DTRAD_CORE -I. -I../../bfd -I../../bfd/../include -DHAVE_s390_elf64_vec -DHAVE_s390_elf32_vec -DHAVE_elf64_le_vec -DHAVE_elf64_be_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec -DHAVE_powerpc_elf32_vec -DHAVE_rs6000_xcoff_vec -DHAVE_powerpc_elf32_le_vec -DHAVE_powerpc_boot_vec -DHAVE_powerpc_elf64_vec -DHAVE_powerpc_elf64_le_vec -DHAVE_arm_elf32_le_vec -DHAVE_arm_elf32_be_vec -DHAVE_aarch64_elf64_le_vec -DHAVE_aarch64_elf64_be_vec -DHAVE_aarch64_elf32_le_vec -DHAVE_aarch64_elf32_be_vec -DHAVE_plugin_vec -DBINDIR=\"/usr/bin\" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -march=z9-109 -mtune=z10 -DDNF_DEBUGINFO_INSTALL -DNEED_RL_STATE_FEDORA_GDB -MT coff-rs6000.lo -MD -MP -MF .deps/coff-rs6000.Tpo -c ../../bfd/coff-rs6000.c -o coff-rs6000.o In file included from ../../bfd/coff-rs6000.c:118:0: ../../bfd/coffcode.h: In function 'coff_new_section_hook': ../../bfd/coffcode.h:1817:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] coffsymbol (section->symbol)->native = native; ^~~~~~~~~~ ... libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../bfd -DTRAD_CORE -I. -I../../bfd -I../../bfd/../include -DHAVE_s390_elf64_vec -DHAVE_s390_elf32_vec -DHAVE_elf64_le_vec -DHAVE_elf64_be_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec -DHAVE_powerpc_elf32_vec -DHAVE_rs6000_xcoff_vec -DHAVE_powerpc_elf32_le_vec -DHAVE_powerpc_boot_vec -DHAVE_powerpc_elf64_vec -DHAVE_powerpc_elf64_le_vec -DHAVE_arm_elf32_le_vec -DHAVE_arm_elf32_be_vec -DHAVE_aarch64_elf64_le_vec -DHAVE_aarch64_elf64_be_vec -DHAVE_aarch64_elf32_le_vec -DHAVE_aarch64_elf32_be_vec -DHAVE_plugin_vec -DBINDIR=\"/usr/bin\" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -march=z9-109 -mtune=z10 -DDNF_DEBUGINFO_INSTALL -DNEED_RL_STATE_FEDORA_GDB -MT coffgen.lo -MD -MP -MF .deps/coffgen.Tpo -c ../../bfd/coffgen.c -o coffgen.o ../../bfd/coffgen.c: In function 'coff_get_lineno': ../../bfd/coffgen.c:1510:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] return coffsymbol (symbol)->lineno; ^~~~~~ ../../bfd/coffgen.c: In function 'coff_get_symbol_info': ../../bfd/coffgen.c:2034:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] if (coffsymbol (symbol)->native != NULL ^~ ../../bfd/coffgen.c:2035:7: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] && coffsymbol (symbol)->native->fix_value ^~ ../../bfd/coffgen.c:2036:7: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] && coffsymbol (symbol)->native->is_sym) ^~ ../../bfd/coffgen.c:2037:5: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] ret->value = coffsymbol (symbol)->native->u.syment.n_value - ^~~ ../../bfd/coffgen.c: In function 'coff_print_symbol': ../../bfd/coffgen.c:2059:9: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] coffsymbol (symbol)->native ? "n" : "g", ^~~~~~~~~~ ../../bfd/coffgen.c:2060:9: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] coffsymbol (symbol)->lineno ? "l" : " "); ^~~~~~~~~~ ../../bfd/coffgen.c:2064:7: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] if (coffsymbol (symbol)->native) ^~ ../../bfd/coffgen.c:2068:4: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] combined_entry_type *combined = coffsymbol (symbol)->native; ^~~~~~~~~~~~~~~~~~~ ../../bfd/coffgen.c:2070:11: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] struct lineno_cache_entry *l = coffsymbol (symbol)->lineno; ^~~~~~~~~~~~~~~~~~ ../../bfd/coffgen.c:2191:6: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] coffsymbol (symbol)->native ? "n" : "g", ^~~~~~~~~~ ../../bfd/coffgen.c:2192:6: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] coffsymbol (symbol)->lineno ? "l" : " ", ^~~~~~~~~~ cc1: all warnings being treated as errors ... For full logs from gdb-7.10.90.20160211-52.fc24 please see http://s390.koji.fedoraproject.org/koji/taskinfo?taskID=2139610 (-0.15 gcc used). For comparison see http://s390.koji.fedoraproject.org/koji/taskinfo?taskID=2140908 when -0.14 gcc is used (the only difference in the buildroot). Version-Release number of selected component (if applicable): gdb-7.11-58.fc24 (but also previous versions are affected) gcc-6.0.0-0.15.fc24.s390x
gcc-6.0.0-0.15.fc24.x86_64 is not yet in the repos to try x86_64 first, I will check it later.
ack, it's almost there, but stuck on a non-responsive builder (I've already pinged rel-engs about it), http://koji.fedoraproject.org/koji/taskinfo?taskID=13234616
reproduced on x86_64 in Rawhide - http://koji.fedoraproject.org/koji/taskinfo?taskID=13257726
[patch] aout+coff: Fix strict-aliasing rules error https://sourceware.org/ml/binutils/2016-03/msg00119.html