public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/105599] New: g++ binary: undefined symbols _main referenced from __start in crt1.0
@ 2022-05-13 21:06 mario_grgic at hotmail dot com
  2022-05-13 22:05 ` [Bug target/105599] g++ by itself is not producing "fatal error: no input files" for darwin target pinskia at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: mario_grgic at hotmail dot com @ 2022-05-13 21:06 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105599

            Bug ID: 105599
           Summary: g++ binary: undefined symbols _main referenced from
                    __start in crt1.0
           Product: gcc
           Version: 12.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mario_grgic at hotmail dot com
  Target Milestone: ---

I have compiled gcc 12.1.0 from source on macOS 10.15.7 (Catalina) with XCode
12.1. I used the following configuration:

```
../configure --prefix=/usr/local --with-gmp=/usr/local --with-mpfr=/usr/local
--with-mpc=/usr/local --with-isl-prefix=/usr/local --with-cloog=/usr/local
--enable-checking=release --enable-languages=c,c++,fortran
--with-sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
--with-system-zlib --with-zsstd=/usr/local --disable-multilib --disable-nls 

```

Everything builds and installs correctly. gcc and other binaries work, however
invoking g++ without any arguments produces

```
$ /usr/local/bin/g++
Undefined symbols for architecture x86_64:
  "_main", referenced from:
      __start in crt1.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
```

Note that g++ works correctly and compiles and produces working binaries when
invoked with correct arguments.

Similar thing happens with c++ binary.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-04-24 18:36 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-13 21:06 [Bug c++/105599] New: g++ binary: undefined symbols _main referenced from __start in crt1.0 mario_grgic at hotmail dot com
2022-05-13 22:05 ` [Bug target/105599] g++ by itself is not producing "fatal error: no input files" for darwin target pinskia at gcc dot gnu.org
2022-05-13 22:21 ` iains at gcc dot gnu.org
2022-05-13 23:03 ` iains at gcc dot gnu.org
2022-05-29 18:27 ` cvs-commit at gcc dot gnu.org
2022-06-15 19:07 ` cvs-commit at gcc dot gnu.org
2022-06-15 19:09 ` iains at gcc dot gnu.org
2023-05-16 19:01 ` cvs-commit at gcc dot gnu.org
2023-05-16 19:10 ` iains at gcc dot gnu.org
2024-04-24 18:36 ` cvs-commit 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).