public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/102525] New: error: failed to read compiled module: Bad file data when trying to use modules possible 98944 regression
@ 2021-09-29 2:32 e9leyland at outlook dot com
2024-03-11 20:59 ` [Bug c++/102525] " ppalka at gcc dot gnu.org
0 siblings, 1 reply; 2+ messages in thread
From: e9leyland at outlook dot com @ 2021-09-29 2:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102525
Bug ID: 102525
Summary: error: failed to read compiled module: Bad file data
when trying to use modules possible 98944 regression
Product: gcc
Version: 11.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: e9leyland at outlook dot com
Target Milestone: ---
I create the precompiled headers for the system headers, one by one
$ g++ -fmodules-ts -std=c++20 -x c++-system-header concepts
$ g++ -fmodules-ts -std=c++20 -x c++-system-header limits
$ g++ -fmodules-ts -std=c++20 -x c++-system-header iostream
I gathered up the required system headers into Reverse
$ cat Reverse
import <concepts>;
import <limits>;
import <iostream>;
$ g++ -fmodules-ts -std=c++20 -x c++-header Reverse
$ ls gcm.cache/,
Reverse.gcm
I try to import the module header
$ head Reverse.cpp
import <Reverse>;
$ make
g++ -fmodules-ts -std=c++20 -I./ -o Reverseexec Reverse.cpp
In module imported at Reverse.cpp:4:1:
./Reverse: error: failed to read compiled module: Bad file data
./Reverse: note: compiled module file is ‘gcm.cache/,/Reverse.gcm’
./Reverse: fatal error: returning to the gate for a mechanical issue
compilation terminated.
make: *** [Makefile:2: Reverseexec] Error 1
I change the imports in Reverse.cpp and it compiles
$ head Reverse.cpp
import <concepts>;
import <limits>;
import <iostream>;
$ make
g++ -fmodules-ts -std=c++20 -o Reverse Reverse.cpp
I found what seems to be a related bug.
[Bug c++/98944] [modules] Failed to read compiled module with a non-exported
partition.
StevenSun2021 at hotmail dot com via Gcc-bugs Mon, 08 Feb 2021 22:49:45 -0800
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98944
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-cygwin/11/lto-wrapper.exe
Target: x86_64-pc-cygwin
Configured with: /mnt/share/cygpkgs/gcc/gcc.x86_64/src/gcc-11.2.0/configure
--srcdir=/mnt/share/cygpkgs/gcc/gcc.x86_64/src/gcc-11.2.0 --prefix=/usr
--exec-prefix=/usr --localstatedir=/var --sysconfdir=/etc
--docdir=/usr/share/doc/gcc --htmldir=/usr/share/doc/gcc/html -C
--build=x86_64-pc-cygwin --host=x86_64-pc-cygwin --target=x86_64-pc-cygwin
--without-libiconv-prefix --without-libintl-prefix --libexecdir=/usr/lib
--with-gcc-major-version-only --enable-shared --enable-shared-libgcc
--enable-static --enable-version-specific-runtime-libs --enable-bootstrap
--enable-__cxa_atexit --with-dwarf2 --with-tune=generic --disable-bootstrap
--enable-languages=c,c++,fortran,lto,objc,obj-c++,jit --enable-graphite
--enable-threads=posix --enable-libatomic --enable-libgomp --enable-libquadmath
--enable-libquadmath-support --disable-libssp --enable-libada --disable-symvers
--with-gnu-ld --with-gnu-as --with-cloog-include=/usr/include/cloog-isl
--without-libiconv-prefix --without-libintl-prefix --with-system-zlib
--enable-linker-build-id --with-default-libstdcxx-abi=gcc4-compatible
--enable-libstdcxx-filesystem-ts
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.0 (GCC)
What am I doing incorrectly? Why am I getting this error,
g++ -fmodules-ts -std=c++20 -I./ -o Reverseexec Reverse.cpp
In module imported at Reverse.cpp:4:1:
./Reverse: error: failed to read compiled module: Bad file data
./Reverse: note: compiled module file is ‘gcm.cache/,/Reverse.gcm’
./Reverse: fatal error: returning to the gate for a mechanical issue
compilation terminated.
make: *** [Makefile:2: Reverseexec] Error 1
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c++/102525] error: failed to read compiled module: Bad file data when trying to use modules possible 98944 regression
2021-09-29 2:32 [Bug c++/102525] New: error: failed to read compiled module: Bad file data when trying to use modules possible 98944 regression e9leyland at outlook dot com
@ 2024-03-11 20:59 ` ppalka at gcc dot gnu.org
0 siblings, 0 replies; 2+ messages in thread
From: ppalka at gcc dot gnu.org @ 2024-03-11 20:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102525
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
CC| |ppalka at gcc dot gnu.org
Target Milestone|--- |13.0
Resolution|--- |FIXED
--- Comment #1 from Patrick Palka <ppalka at gcc dot gnu.org> ---
This seems fixed in GCC 13/trunk.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-03-11 20:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-29 2:32 [Bug c++/102525] New: error: failed to read compiled module: Bad file data when trying to use modules possible 98944 regression e9leyland at outlook dot com
2024-03-11 20:59 ` [Bug c++/102525] " ppalka at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).