Re: [PATCH] Darwin, configury : Allow for specification and detection of dsymutil.

2021-07-06 Thread Iain Sandoe



> On 5 Jul 2021, at 21:47, Joseph Myers  wrote:
> 
> On Mon, 5 Jul 2021, Iain Sandoe wrote:
> 
>> Hello Joseph,
>> 
>>> On 5 Jul 2021, at 21:21, Joseph Myers  wrote:
>>> 
>>> On Sun, 4 Jul 2021, Iain Sandoe wrote:
>>> 
* configure.ac: Handle --with-dsymutil in the same way as we
do for the assembler and linker.  (DEFAULT_DSYMUTIL): New.
Extract the type and version for the dsymutil configured or
found by the default searches.
>>> 
>>> This is missing documentation of --with-dsymutil in install.texi.
>> 
>> oops, sorry.
>> 
>> following the style of the other entries would this be suitable?
>> 
>> @item --with-dsymutil=@var{pathname}
>> Same as @uref{#with-as,,@option{--with-as}}
>> but for the debug linker (only used on Darwin platforms so far).
> 
> Yes.

This is what I’ve pushed (tested with make info and make pdf).
thanks,
Iain

===

Documentation : Describe --with-dsymutil configure option.

This adds documentation for the dsymutil configuration option
introduced with commit r12-2037-g3b5e8ee4f1ec.

Signed-off-by: Iain Sandoe 

gcc/ChangeLog:

* doc/install.texi: Document --with-dsymutil.
---
 gcc/doc/install.texi | 4 
 1 file changed, 4 insertions(+)

diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 94b167a3ed3..6eee1bb43d4 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -1084,6 +1084,10 @@ but for the linker.
 Same as @uref{#with-as,,@option{--with-as}}
 but for the linker.
 
+@item --with-dsymutil=@var{pathname}
+Same as @uref{#with-as,,@option{--with-as}}
+but for the debug linker (only used on Darwin platforms so far).
+
 @item --with-stabs
 Specify that stabs debugging
 information should be used instead of whatever format the host normally
-- 
2.24.1




Re: [PATCH] Darwin, configury : Allow for specification and detection of dsymutil.

2021-07-05 Thread Joseph Myers
On Mon, 5 Jul 2021, Iain Sandoe wrote:

> Hello Joseph,
> 
> > On 5 Jul 2021, at 21:21, Joseph Myers  wrote:
> > 
> > On Sun, 4 Jul 2021, Iain Sandoe wrote:
> > 
> >>* configure.ac: Handle --with-dsymutil in the same way as we
> >>do for the assembler and linker.  (DEFAULT_DSYMUTIL): New.
> >>Extract the type and version for the dsymutil configured or
> >>found by the default searches.
> > 
> > This is missing documentation of --with-dsymutil in install.texi.
> 
> oops, sorry.
> 
> following the style of the other entries would this be suitable?
> 
> @item --with-dsymutil=@var{pathname}
> Same as @uref{#with-as,,@option{--with-as}}
> but for the debug linker (only used on Darwin platforms so far).

Yes.

-- 
Joseph S. Myers
jos...@codesourcery.com


Re: [PATCH] Darwin, configury : Allow for specification and detection of dsymutil.

2021-07-05 Thread Iain Sandoe
Hello Joseph,

> On 5 Jul 2021, at 21:21, Joseph Myers  wrote:
> 
> On Sun, 4 Jul 2021, Iain Sandoe wrote:
> 
>>  * configure.ac: Handle --with-dsymutil in the same way as we
>>  do for the assembler and linker.  (DEFAULT_DSYMUTIL): New.
>>  Extract the type and version for the dsymutil configured or
>>  found by the default searches.
> 
> This is missing documentation of --with-dsymutil in install.texi.

oops, sorry.

following the style of the other entries would this be suitable?

@item --with-dsymutil=@var{pathname}
Same as @uref{#with-as,,@option{--with-as}}
but for the debug linker (only used on Darwin platforms so far).


thanks
Iain



Re: [PATCH] Darwin, configury : Allow for specification and detection of dsymutil.

2021-07-05 Thread Joseph Myers
On Sun, 4 Jul 2021, Iain Sandoe wrote:

>   * configure.ac: Handle --with-dsymutil in the same way as we
>   do for the assembler and linker.  (DEFAULT_DSYMUTIL): New.
>   Extract the type and version for the dsymutil configured or
>   found by the default searches.

This is missing documentation of --with-dsymutil in install.texi.

-- 
Joseph S. Myers
jos...@codesourcery.com


Re: [PATCH] Darwin, configury : Allow for specification and detection of dsymutil.

2021-07-05 Thread Richard Biener via Gcc-patches
On Sun, Jul 4, 2021 at 10:22 PM Iain Sandoe  wrote:
>
> Hi,
>
> IMO this was an omission when the dsymutil program was added
> (before my time).  Essentially, we have been ‘getting away with it’
> on Darwin because of (a) restrictions in DWARF versions and (b)
> that the installed tools handle a wide range of platform versions and
> archs.
>
> However, (a) is a barrier to moving Darwin to DWARF-4 or greater
> and (b) is no longer true for people who might build cross- toolchains
> for older Darwin (or, the motiovating case, for brand new Arm64
> Darwin).  In order to support necessary tests for (a) we produce a
> version record that can be tested.
>
> This replicates the logic used for ‘as’ and ‘ld’ and now correctly
> reports for ‘-v’ and works with discovery of installed “binutils” in the
> target dir (or for specific paths given).
>
> tested across the Darwin range and on crosses and canadian (native)
> crosses to powerpc and Arm64 darwin.  Also tested on x86_64
> and powerpc64 linux.
>
> OK for master?

OK.

Thanks,
Richard.

> thanks
> Iain
>
> ===
>
> In order to enable DWARF versions > 2 we need a sufficiently modern
> version of dsymutil (in addition to the assembler / linker).  This
> allows the user to configure a different path from the installed one.
>
> In addition, there are several sources of dsymutil so we differentiate
> these in order to be get accurate version information.
>
> Signed-off-by: Iain Sandoe 
>
> gcc/ChangeLog:
>
> * configure.ac: Handle --with-dsymutil in the same way as we
> do for the assembler and linker.  (DEFAULT_DSYMUTIL): New.
> Extract the type and version for the dsymutil configured or
> found by the default searches.
> * config.in: Regenerated.
> * configure: Regenerated.
> * collect2.c (do_dsymutil): Handle locating dsymutil in the
> same way as for the assembler and  linker.
> * config/darwin.h (DSYMUTIL): Delete.
> * gcc.c: Report a configured dsymutil correctly.
>
> ChangeLog:
>
> * Makefile.def: Add dsymutil defs.
> * Makefile.in: Regenerated.
> * Makefile.tpl: Add dsymutil to flags.
> * configure: Regenerated.
> * configure.ac: Add dsymutil to target and build recipes.
> ---
>  Makefile.def|   1 +
>  Makefile.in |  10 ++
>  Makefile.tpl|   9 +
>  configure   | 413 
>  configure.ac|   6 +
>  gcc/collect2.c  |  40 -
>  gcc/config.in   |  12 ++
>  gcc/config/darwin.h |   2 -
>  gcc/configure   | 166 +-
>  gcc/configure.ac|  96 +-
>  gcc/exec-tool.in|   8 +
>  gcc/gcc.c   |   5 +
>  12 files changed, 757 insertions(+), 11 deletions(-)
>
> diff --git a/Makefile.def b/Makefile.def
> index c83d9c4a813..fbfdb6fee08 100644
> --- a/Makefile.def
> +++ b/Makefile.def
> @@ -291,6 +291,7 @@ flags_to_pass = { flag= CFLAGS_FOR_TARGET ; };
>  flags_to_pass = { flag= CPPFLAGS_FOR_TARGET ; };
>  flags_to_pass = { flag= CXXFLAGS_FOR_TARGET ; };
>  flags_to_pass = { flag= DLLTOOL_FOR_TARGET ; };
> +flags_to_pass = { flag= DSYMUTIL_FOR_TARGET ; };
>  flags_to_pass = { flag= FLAGS_FOR_TARGET ; };
>  flags_to_pass = { flag= GFORTRAN_FOR_TARGET ; };
>  flags_to_pass = { flag= GOC_FOR_TARGET ; };
>
> diff --git a/Makefile.tpl b/Makefile.tpl
> index 6e0337fb48f..bffd85bd68e 100644
> --- a/Makefile.tpl
> +++ b/Makefile.tpl
> @@ -162,6 +162,7 @@ BUILD_EXPORTS = \
> GDC="$(GDC_FOR_BUILD)"; export GDC; \
> GDCFLAGS="$(GDCFLAGS_FOR_BUILD)"; export GDCFLAGS; \
> DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
> +   DSYMUTIL="$(DSYMUTIL_FOR_BUILD)"; export DSYMUTIL; \
> LD="$(LD_FOR_BUILD)"; export LD; \
> LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \
> NM="$(NM_FOR_BUILD)"; export NM; \
> @@ -203,6 +204,7 @@ HOST_EXPORTS = \
> CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
> CXX_FOR_BUILD="$(CXX_FOR_BUILD)"; export CXX_FOR_BUILD; \
> DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
> +   DSYMUTIL="$(DSYMUTIL)"; export DSYMUTIL; \
> LD="$(LD)"; export LD; \
> LDFLAGS="$(STAGE1_LDFLAGS) $(LDFLAGS)"; export LDFLAGS; \
> NM="$(NM)"; export NM; \
> @@ -215,6 +217,7 @@ HOST_EXPORTS = \
> READELF="$(READELF)"; export READELF; \
> AR_FOR_TARGET="$(AR_FOR_TARGET)"; export AR_FOR_TARGET; \
> AS_FOR_TARGET="$(AS_FOR_TARGET)"; export AS_FOR_TARGET; \
> +   DSYMUTIL_FOR_TARGET="$(DSYMUTIL_FOR_TARGET)"; export 
> DSYMUTIL_FOR_TARGET; \
> GCC_FOR_TARGET="$(GCC_FOR_TARGET)"; export GCC_FOR_TARGET; \
> LD_FOR_TARGET="$(LD_FOR_TARGET)"; export LD_FOR_TARGET; \
> NM_FOR_TARGET="$(NM_FOR_TARGET)"; export NM_FOR_TARGET; \
> @@ -297,6 +300,7 @@ BASE_TARGET_EXPORTS = \
> GOC="$(GOC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export 
> GOC; \
> GDC="$(GDC_FOR_TARGET) $(XGCC_FLAGS_FO

[PATCH] Darwin, configury : Allow for specification and detection of dsymutil.

2021-07-04 Thread Iain Sandoe
Hi,

IMO this was an omission when the dsymutil program was added
(before my time).  Essentially, we have been ‘getting away with it’
on Darwin because of (a) restrictions in DWARF versions and (b)
that the installed tools handle a wide range of platform versions and
archs.

However, (a) is a barrier to moving Darwin to DWARF-4 or greater
and (b) is no longer true for people who might build cross- toolchains
for older Darwin (or, the motiovating case, for brand new Arm64
Darwin).  In order to support necessary tests for (a) we produce a
version record that can be tested.

This replicates the logic used for ‘as’ and ‘ld’ and now correctly
reports for ‘-v’ and works with discovery of installed “binutils” in the
target dir (or for specific paths given).

tested across the Darwin range and on crosses and canadian (native)
crosses to powerpc and Arm64 darwin.  Also tested on x86_64 
and powerpc64 linux.

OK for master?
thanks
Iain

===

In order to enable DWARF versions > 2 we need a sufficiently modern
version of dsymutil (in addition to the assembler / linker).  This
allows the user to configure a different path from the installed one.

In addition, there are several sources of dsymutil so we differentiate
these in order to be get accurate version information.

Signed-off-by: Iain Sandoe 

gcc/ChangeLog:

* configure.ac: Handle --with-dsymutil in the same way as we
do for the assembler and linker.  (DEFAULT_DSYMUTIL): New.
Extract the type and version for the dsymutil configured or
found by the default searches.
* config.in: Regenerated.
* configure: Regenerated.
* collect2.c (do_dsymutil): Handle locating dsymutil in the
same way as for the assembler and  linker.
* config/darwin.h (DSYMUTIL): Delete.
* gcc.c: Report a configured dsymutil correctly.

ChangeLog:

* Makefile.def: Add dsymutil defs.
* Makefile.in: Regenerated.
* Makefile.tpl: Add dsymutil to flags.
* configure: Regenerated.
* configure.ac: Add dsymutil to target and build recipes.
---
 Makefile.def|   1 +
 Makefile.in |  10 ++
 Makefile.tpl|   9 +
 configure   | 413 
 configure.ac|   6 +
 gcc/collect2.c  |  40 -
 gcc/config.in   |  12 ++
 gcc/config/darwin.h |   2 -
 gcc/configure   | 166 +-
 gcc/configure.ac|  96 +-
 gcc/exec-tool.in|   8 +
 gcc/gcc.c   |   5 +
 12 files changed, 757 insertions(+), 11 deletions(-)

diff --git a/Makefile.def b/Makefile.def
index c83d9c4a813..fbfdb6fee08 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -291,6 +291,7 @@ flags_to_pass = { flag= CFLAGS_FOR_TARGET ; };
 flags_to_pass = { flag= CPPFLAGS_FOR_TARGET ; };
 flags_to_pass = { flag= CXXFLAGS_FOR_TARGET ; };
 flags_to_pass = { flag= DLLTOOL_FOR_TARGET ; };
+flags_to_pass = { flag= DSYMUTIL_FOR_TARGET ; };
 flags_to_pass = { flag= FLAGS_FOR_TARGET ; };
 flags_to_pass = { flag= GFORTRAN_FOR_TARGET ; };
 flags_to_pass = { flag= GOC_FOR_TARGET ; };

diff --git a/Makefile.tpl b/Makefile.tpl
index 6e0337fb48f..bffd85bd68e 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -162,6 +162,7 @@ BUILD_EXPORTS = \
GDC="$(GDC_FOR_BUILD)"; export GDC; \
GDCFLAGS="$(GDCFLAGS_FOR_BUILD)"; export GDCFLAGS; \
DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
+   DSYMUTIL="$(DSYMUTIL_FOR_BUILD)"; export DSYMUTIL; \
LD="$(LD_FOR_BUILD)"; export LD; \
LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \
NM="$(NM_FOR_BUILD)"; export NM; \
@@ -203,6 +204,7 @@ HOST_EXPORTS = \
CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
CXX_FOR_BUILD="$(CXX_FOR_BUILD)"; export CXX_FOR_BUILD; \
DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
+   DSYMUTIL="$(DSYMUTIL)"; export DSYMUTIL; \
LD="$(LD)"; export LD; \
LDFLAGS="$(STAGE1_LDFLAGS) $(LDFLAGS)"; export LDFLAGS; \
NM="$(NM)"; export NM; \
@@ -215,6 +217,7 @@ HOST_EXPORTS = \
READELF="$(READELF)"; export READELF; \
AR_FOR_TARGET="$(AR_FOR_TARGET)"; export AR_FOR_TARGET; \
AS_FOR_TARGET="$(AS_FOR_TARGET)"; export AS_FOR_TARGET; \
+   DSYMUTIL_FOR_TARGET="$(DSYMUTIL_FOR_TARGET)"; export 
DSYMUTIL_FOR_TARGET; \
GCC_FOR_TARGET="$(GCC_FOR_TARGET)"; export GCC_FOR_TARGET; \
LD_FOR_TARGET="$(LD_FOR_TARGET)"; export LD_FOR_TARGET; \
NM_FOR_TARGET="$(NM_FOR_TARGET)"; export NM_FOR_TARGET; \
@@ -297,6 +300,7 @@ BASE_TARGET_EXPORTS = \
GOC="$(GOC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GOC; \
GDC="$(GDC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GDC; \
DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
+   DSYMUTIL="$(DSYMUTIL_FOR_TARGET)"; export DSYMUTIL; \
LD="$(COMPILER_LD_FOR_TARGET)"; export LD; \
LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
LIPO="$(LIPO_FOR_TARGET