https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85870
--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> --- (In reply to Ramana Radhakrishnan from comment #4) > (In reply to Martin Liška from comment #3) > > Can't reproduce with GCC 7.3.0 on x86_64: > > > > + gcc-7 -O2 -flto -c test_1.i -o test_1.o > > + gcc-7 -O2 -flto -c test_2.i -o test_2.o > > + gcc-7 test_1.o test_2.o > > /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: > > /usr/lib64/gcc/x86_64-suse-linux/7/../../../../lib64/crt1.o: in function > > `_start': > > /home/abuild/rpmbuild/BUILD/glibc-2.27/csu/../sysdeps/x86_64/start.S:104: > > undefined reference to `main' > > collect2: error: ld returned 1 exit status > > > > Richi how did you achieve to reproduce that? > > It's still failing on aarch64-none-linux-gnu. So that doesn't mean this goes > waiting. Native or cross compiler? Because cross compiler works fine for me: $ aarch64-suse-linux-g++-8 -c test_1.i -c -flto $ aarch64-suse-linux-g++-8 -c test_2.i -c -flto $ /usr/lib64/gcc/aarch64-suse-linux/8/lto1 test_1.o test_2.o Reading object files: test_1.o test_2.o {GC start 1697k} Reading the callgraph Merging declarations Reading summaries Reading function bodies: Performing interprocedural optimizations <whole-program> <profile_estimate> <icf> <devirt> <cp> <cdtor> <fnsummary> <inline> <pure-const> <free-fnsummary> <static-var> <single-use> <comdats>Assembling functions: <materialize-all-clones> init_xyz_0 init_xyz_1 Time variable usr sys wall GGC phase setup : 0.00 ( 0%) 0.00 ( 0%) 0.00 ( 0%) 1847 kB ( 1%) phase opt and generate : 2.11 (100%) 0.12 ( 92%) 2.23 (100%) 188629 kB ( 99%) phase finalize : 0.00 ( 0%) 0.01 ( 8%) 0.01 ( 0%) 0 kB ( 0%) lto stream inflate : 0.12 ( 6%) 0.03 ( 23%) 0.15 ( 7%) 0 kB ( 0%) ipa lto constructors in : 0.65 ( 31%) 0.03 ( 23%) 0.69 ( 31%) 188513 kB ( 99%) TOTAL : 2.11 0.13 2.24 190523 kB