[Bug target/105599] g++ by itself is not producing "fatal error: no input files" for darwin target

2024-04-24 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105599

--- Comment #9 from GCC Commits  ---
The releases/gcc-11 branch has been updated by Iain D Sandoe
:

https://gcc.gnu.org/g:3bb14f6ed5bc70e25381c67963c90eaab91eca22

commit r11-11353-g3bb14f6ed5bc70e25381c67963c90eaab91eca22
Author: Iain Sandoe 
Date:   Sun May 29 16:14:32 2022 +0100

Darwin: Fix empty g++ command lines [PR105599].

An empty g++ command line should produce a diagnostic that there are no
inputs.  The PR is that currently Darwin produces a dignostic about missing
link items instead - this is because (errnoeously), for this driver, we are
creating a link job for empty command lines.

The problem occurs in four stages:

 The g++ driver appends -shared-libgcc to the command line.

 The Darwin driver_init code in the backend does not see this (it sees an
 empty command line).

 When the back end driver code driver sees an empty command line, it does
not
 add any supplementary flags (e.g. asm-macosx-version-min) - precisely to
 avoid anything being claimed as an input_file and therefore triggering a
link
 line.

 Since we do not have a value for asm-macosx-version-min when processing
the
 driver specs, we unconditionally inject 'multiply_defined suppress' which
is
 used with shared libgcc (but only intended on very old Darwin).  This then
 causes the generation of a link job.

The solution, for the present, is to move version-specific link params to
the
LINK_SPEC so that they are only processed when a link job has already been
decided.

Signed-off-by: Iain Sandoe 

PR target/105599

gcc/ChangeLog:

* config/darwin.h: Move versions-specific handling of
multiply_defined
from SUBTARGET_DRIVER_SELF_SPECS to LINK_SPEC.

(cherry picked from commit 794737976b9a6418eab817f143bb4eb2d0c834d2)

[Bug target/105599] g++ by itself is not producing "fatal error: no input files" for darwin target

2023-05-16 Thread iains at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105599

Iain Sandoe  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #8 from Iain Sandoe  ---
fixed for affected open branches

[Bug target/105599] g++ by itself is not producing "fatal error: no input files" for darwin target

2023-05-16 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105599

--- Comment #7 from CVS Commits  ---
The releases/gcc-11 branch has been updated by Iain D Sandoe
:

https://gcc.gnu.org/g:a8307cfd66d29efae9c28f5b32bd677398c92dfe

commit r11-10780-ga8307cfd66d29efae9c28f5b32bd677398c92dfe
Author: Iain Sandoe 
Date:   Sun May 29 16:14:32 2022 +0100

Darwin: Fix empty g++ command lines [PR105599].

An empty g++ command line should produce a diagnostic that there are no
inputs.  The PR is that currently Darwin produces a dignostic about missing
link items instead - this is because (errnoeously), for this driver, we are
creating a link job for empty command lines.

The problem occurs in four stages:

 The g++ driver appends -shared-libgcc to the command line.

 The Darwin driver_init code in the backend does not see this (it sees an
 empty command line).

 When the back end driver code driver sees an empty command line, it does
not
 add any supplementary flags (e.g. asm-macosx-version-min) - precisely to
 avoid anything being claimed as an input_file and therefore triggering a
link
 line.

 Since we do not have a value for asm-macosx-version-min when processing
the
 driver specs, we unconditionally inject 'multiply_defined suppress' which
is
 used with shared libgcc (but only intended on very old Darwin).  This then
 causes the generation of a link job.

The solution, for the present, is to move version-specific link params to
the
LINK_SPEC so that they are only processed when a link job has already been
decided.

Signed-off-by: Iain Sandoe 

PR target/105599

gcc/ChangeLog:

* config/darwin.h: Move versions-specific handling of
multiply_defined
from SUBTARGET_DRIVER_SELF_SPECS to LINK_SPEC.

(cherry picked from commit 794737976b9a6418eab817f143bb4eb2d0c834d2)

[Bug target/105599] g++ by itself is not producing "fatal error: no input files" for darwin target

2022-06-15 Thread iains at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105599

--- Comment #6 from Iain Sandoe  ---
needed on 11.x

[Bug target/105599] g++ by itself is not producing "fatal error: no input files" for darwin target

2022-06-15 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105599

--- Comment #5 from CVS Commits  ---
The releases/gcc-12 branch has been updated by Iain D Sandoe
:

https://gcc.gnu.org/g:58c0bc2b62cdbbe9d9677b448fe52a8c54044276

commit r12-8484-g58c0bc2b62cdbbe9d9677b448fe52a8c54044276
Author: Iain Sandoe 
Date:   Sun May 29 16:14:32 2022 +0100

Darwin: Fix empty g++ command lines [PR105599].

An empty g++ command line should produce a diagnostic that there are no
inputs.  The PR is that currently Darwin produces a dignostic about missing
link items instead - this is because (errnoeously), for this driver, we are
creating a link job for empty command lines.

The problem occurs in four stages:

 The g++ driver appends -shared-libgcc to the command line.

 The Darwin driver_init code in the backend does not see this (it sees an
 empty command line).

 When the back end driver code driver sees an empty command line, it does
not
 add any supplementary flags (e.g. asm-macosx-version-min) - precisely to
 avoid anything being claimed as an input_file and therefore triggering a
link
 line.

 Since we do not have a value for asm-macosx-version-min when processing
the
 driver specs, we unconditionally inject 'multiply_defined suppress' which
is
 used with shared libgcc (but only intended on very old Darwin).  This then
 causes the generation of a link job.

The solution, for the present, is to move version-specific link params to
the
LINK_SPEC so that they are only processed when a link job has already been
decided.

Signed-off-by: Iain Sandoe 

PR target/105599

gcc/ChangeLog:

* config/darwin.h: Move versions-specific handling of
multiply_defined
from SUBTARGET_DRIVER_SELF_SPECS to LINK_SPEC.

(cherry picked from commit 794737976b9a6418eab817f143bb4eb2d0c834d2)

[Bug target/105599] g++ by itself is not producing "fatal error: no input files" for darwin target

2022-05-29 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105599

--- Comment #4 from CVS Commits  ---
The master branch has been updated by Iain D Sandoe :

https://gcc.gnu.org/g:794737976b9a6418eab817f143bb4eb2d0c834d2

commit r13-818-g794737976b9a6418eab817f143bb4eb2d0c834d2
Author: Iain Sandoe 
Date:   Sun May 29 16:14:32 2022 +0100

Darwin: Fix empty g++ command lines [PR105599].

An empty g++ command line should produce a diagnostic that there are no
inputs.  The PR is that currently Darwin produces a dignostic about missing
link items instead - this is because (errnoeously), for this driver, we are
creating a link job for empty command lines.

The problem occurs in four stages:

 The g++ driver appends -shared-libgcc to the command line.

 The Darwin driver_init code in the backend does not see this (it sees an
 empty command line).

 When the back end driver code driver sees an empty command line, it does
not
 add any supplementary flags (e.g. asm-macosx-version-min) - precisely to
 avoid anything being claimed as an input_file and therefore triggering a
link
 line.

 Since we do not have a value for asm-macosx-version-min when processing
the
 driver specs, we unconditionally inject 'multiply_defined suppress' which
is
 used with shared libgcc (but only intended on very old Darwin).  This then
 causes the generation of a link job.

The solution, for the present, is to move version-specific link params to
the
LINK_SPEC so that they are only processed when a link job has already been
decided.

Signed-off-by: Iain Sandoe 

PR target/105599

gcc/ChangeLog:

* config/darwin.h: Move versions-specific handling of
multiply_defined
from SUBTARGET_DRIVER_SELF_SPECS to LINK_SPEC.

[Bug target/105599] g++ by itself is not producing "fatal error: no input files" for darwin target

2022-05-13 Thread iains at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105599

Iain Sandoe  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2022-05-13
 Ever confirmed|0   |1

--- Comment #3 from Iain Sandoe  ---
gcc version 12.0.1 20220429 (prerelease) [gcc-12-1rc1 revision
r12-8321-g621650f64fb6] (GCC) 
gcc-12-1-darwin mini-07-cat:gcc-git-12 isandoe$
/opt/iains/x86_64-apple-darwin19/gcc-12-1rc1/bin/gcc
gcc: fatal error: no input files
compilation terminated.

$ /opt/iains/x86_64-apple-darwin19/gcc-12-1rc1/bin/g++
ld: -rpath can only be used when targeting Mac OS X 10.5 or later
collect2: error: ld returned 1 exit status

So, we have some addition to the command line from the g++ driver that is
causing this (the actual reported problem is not significant, the reason is
that the command line is not being seen as empty by the darwin driver)

[Bug target/105599] g++ by itself is not producing "fatal error: no input files" for darwin target

2022-05-13 Thread iains at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105599

--- Comment #2 from Iain Sandoe  ---
hmm .. that issue had been found and fixed, I will have to check what happened.

[Bug target/105599] g++ by itself is not producing "fatal error: no input files" for darwin target

2022-05-13 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105599

Andrew Pinski  changed:

   What|Removed |Added

  Component|c++ |target
   Keywords||diagnostic
Summary|g++ binary: undefined   |g++ by itself is not
   |symbols _main referenced|producing "fatal error: no
   |from __start in crt1.0  |input files" for darwin
   ||target
 Target||x86_64-darwin*
   Severity|normal  |trivial

--- Comment #1 from Andrew Pinski  ---
On Linux this produces:
apinski@xeond:~/src/p4/octeontxkpu$ ~/upstream-gcc/bin/g++
g++: fatal error: no input files
compilation terminated.

So it is a darwin specific issue but it is a minor one as it is just a
diagnostic issue with invalid invocation anyways.