Re: [ping] Re: [patch v2] support for multiarch systems

2012-11-20 Thread Matthias Klose
Am 14.11.2012 21:44, schrieb Ian Lance Taylor:
> On Sun, Nov 4, 2012 at 7:45 AM, Matthias Klose  wrote:
>>
>> now testing the attached patch.
> 
>> + when 1 is passed,
>> +   - the multiarch path specified with
>> + -imultiarch, when 2 is passed.  */
> 
> s/when 1 is passed/when set to 1/
> Same for 2.
> 
> This is OK with that change.
> 
> Thanks and sorry for the delay in review.

thanks for finishing the review. I'm checking in the following patch to move out
the multiarch paragraph out of the multilib documentation as obvious.

  Matthias

 2012-11-20  Matthias Klose  

+   * doc/install.texi: Move multiarch paragraph out of multilib
+   documentation.
+
+2012-11-20  Matthias Klose  
+
* config/arm/t-linux-eabi: Define MULTIARCH_DIRNAME for linux target.

 2012-11-20  Richard Sandiford  
Index: gcc/doc/install.texi
===
--- gcc/doc/install.texi(revision 193684)
+++ gcc/doc/install.texi(working copy)
@@ -1027,12 +1027,6 @@
 @code{gnu2}, which select between the original GNU dialect and the GNU TLS
 descriptor-based dialect.

-@item --disable-multilib
-Specify that multiple target
-libraries to support different target variants, calling
-conventions, etc.@: should not be built.  The default is to build a
-predefined set of them.
-
 @item --enable-multiarch
 Specify whether to enable or disable multiarch support.  The default is
 to check for glibc start files in a multiarch location, and enable it
@@ -1042,6 +1036,12 @@
 More documentation about multiarch can be found at
 @uref{http://wiki.debian.org/Multiarch}.

+@item --disable-multilib
+Specify that multiple target
+libraries to support different target variants, calling
+conventions, etc.@: should not be built.  The default is to build a
+predefined set of them.
+
 Some targets provide finer-grained control over which multilibs are built
 (e.g., @option{--disable-softfloat}):
 @table @code



Re: [ping] Re: [patch v2] support for multiarch systems

2012-11-15 Thread Eric Botcazou
> ahh, this is with GNU make 3.80. Checked in the following patch as obvious.

Thanks!

-- 
Eric Botcazou


Re: [ping] Re: [patch v2] support for multiarch systems

2012-11-15 Thread Matthias Klose
Am 15.11.2012 12:41, schrieb Eric Botcazou:
>> re-attaching the updated patch with the fixed comment in genmultilib.
> 
> This has introduced:
> 
> make[3]: Leaving directory `/red.a/gnatmail/gcc-x/build-red/x86_64-
> linux/gnat/obj/libdecnumber'
> make[3]: Entering directory `/red.a/gnatmail/gcc-x/build-red/x86_64-
> linux/gnat/obj/gcc'
> Makefile:538: Extraneous text after `else' directive
> Makefile:541: *** only one `else' per conditional.  Stop.

ahh, this is with GNU make 3.80. Checked in the following patch as obvious.

  Matthias

2012-11-15  Matthias Klose  

	* Makefile.in (if_multiarch): Don't use a GNU make 3.81 feature.

Index: Makefile.in
===
--- Makefile.in	(Revision 193528)
+++ Makefile.in	(Arbeitskopie)
@@ -535,11 +535,13 @@
 with_float = @with_float@
 ifeq ($(enable_multiarch),yes)
   if_multiarch = $(1)
-else ifeq ($(enable_multiarch),auto)
-  # SYSTEM_HEADER_DIR is makefile syntax, cannot be evaluated in configure.ac
-  if_multiarch = $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib/*/crti.o),$(1))
 else
-  if_multiarch =
+  ifeq ($(enable_multiarch),auto)
+# SYSTEM_HEADER_DIR is makefile syntax, cannot be evaluated in configure.ac
+if_multiarch = $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib/*/crti.o),$(1))
+  else
+if_multiarch =
+  endif
 endif
 
 # 


Re: [ping] Re: [patch v2] support for multiarch systems

2012-11-15 Thread Eric Botcazou
> re-attaching the updated patch with the fixed comment in genmultilib.

This has introduced:

make[3]: Leaving directory `/red.a/gnatmail/gcc-x/build-red/x86_64-
linux/gnat/obj/libdecnumber'
make[3]: Entering directory `/red.a/gnatmail/gcc-x/build-red/x86_64-
linux/gnat/obj/gcc'
Makefile:538: Extraneous text after `else' directive
Makefile:541: *** only one `else' per conditional.  Stop.


# Multiarch support
enable_multiarch = auto
with_float = 
ifeq ($(enable_multiarch),yes)
  if_multiarch = $(1)
else ifeq ($(enable_multiarch),auto)
  # SYSTEM_HEADER_DIR is makefile syntax, cannot be evaluated in configure.ac
  if_multiarch = $(if $(wildcard $(shell echo 
$(SYSTEM_HEADER_DIR))/../../usr/lib/*/crti.o),$(1))
else
  if_multiarch =
endif

-- 
Eric Botcazou


Re: [ping] Re: [patch v2] support for multiarch systems

2012-11-14 Thread Ian Lance Taylor
On Sun, Nov 4, 2012 at 7:45 AM, Matthias Klose  wrote:
>
> now testing the attached patch.

> +  when 1 is passed,
> +- the multiarch path specified with
> +  -imultiarch, when 2 is passed.  */

s/when 1 is passed/when set to 1/
Same for 2.

This is OK with that change.

Thanks and sorry for the delay in review.

Ian


Re: [ping] Re: [patch v2] support for multiarch systems

2012-11-04 Thread Matthias Klose

Am 02.11.2012 18:37, schrieb Ian Lance Taylor:

On Fri, Nov 2, 2012 at 6:26 AM, Matthias Klose  wrote:



+ifeq ($(enable_multiarch),yes)
+  if_multiarch = $(1)
+else ifeq ($(enable_multiarch),auto-detect)
+  if_multiarch = $(if $(wildcard $(shell echo
$(SYSTEM_HEADER_DIR))/../../usr/lib/*/crti.o),$(1))
+else
+  if_multiarch =
+endif

This is nicely tricky but I don't understand why you are doing this in
such a confusing way.  Why not simply set the names in config.gcc?
What information do you have at make time that you don't have at
configure time?



this is for the auto case. SYSTEM_HEADER_DIR is not accessible/available
from
config.gcc. This is the same approach as taken for MULTILIB_OSDDIRNAMES.
Also setting the names for the multiarch directories in the same place as
done for for the MULTILIB_OSDIRNAMES seems to be better choice.


SYSTEM_HEADER_DIR is available in gcc/configure.ac, and you could do
the $(if $(wildcard $(shell echo

$(SYSTEM_HEADER_DIR))/../../usr/lib/*/crti.o) there.  I can't see any reason to 
do it at make time rather than configure time.


in the thread starting at 
http://gcc.gnu.org/ml/gcc-patches/2007-09/msg00696.html it was suggested to use 
this construct.


SYSTEM_HEADER_DIR is in Makefile syntax, and cannot be evaluated in 
configure.ac.  Now you could add a SYSTEM_HEADER_DIR_sh variable to track the 
same configuration in shell syntax, but this seems to be error prone to 
maintain. Plus the Makefile has the comment for this macro saying "to be 
overridden by targets".


For now, I added a comment in the Makefile.in, why SYSTEM_HEADER_DIR cannot be 
used in configure.ac.



+ if (*q2 == ':')
+   end = q2;


Don't reuse end here.  Use a new variable.


done.


Please update the comment for set_multilib_dir.  It's not a very good
comment, but it does describe the syntax, and you seem to be changing
the syntax.


added:
  A subdirectory name is optionally followed by a colon and the corresponding
  multiarch name.


-  if (this_path[0] == '.' && this_path[1] == ':')
+  if (this_path[0] == '.' && this_path[1] == ':' && this_path[2] != ':')


The existing comment here is reasonably clear.  Please update the
comment to show why this change is correct.


updated comment:
  /* When --disable-multilib was used but target defines
 MULTILIB_OSDIRNAMES, entries starting with .: (and not starting
 with .:: for multiarch configurations) are there just to find
 multilib_os_dir, so skip them from output.  */


+Specify wether to enable or disable multiarch support.  The default is


s/wether/whether/


+to detect for glibc start files in a multiarch location, and enable it


s/detect/check/ or something along those lines.


done.

now testing the attached patch.

  Matthias

2012-11-04  Matthias Klose  

	* doc/invoke.texi: Document -print-multiarch.
	* doc/install.texi: Document --enable-multiarch.
	* doc/fragments.texi: Document MULTILIB_OSDIRNAMES, MULTIARCH_DIRNAME.
	* configure.ac: Add --enable-multiarch option.
	* configure: Regenerate.
	* Makefile.in (s-mlib): Pass MULTIARCH_DIRNAME to genmultilib.
	enable_multiarch, with_float: New macros.
	if_multiarch: New macro, define in terms of enable_multiarch.
	* genmultilib: Add new argument for the multiarch name.
	* gcc.c (multiarch_dir): Define.
	(for_each_path): Search for multiarch suffixes.
	(driver_handle_option): Handle multiarch option.
	(do_spec_1): Pass -imultiarch if defined.
	(main): Print multiarch.
	(set_multilib_dir): Separate multilib and multiarch names
	from multilib_select.
	(print_multilib_info): Ignore multiarch names in multilib_select.
	* incpath.c (add_standard_paths): Search the multiarch include dirs.
	* cppdefault.h (default_include): Document multiarch in multilib
	member.
	* cppdefault.c: [LOCAL_INCLUDE_DIR, STANDARD_INCLUDE_DIR] Add an
include directory for multiarch directories.
	* common.opt: New options --print-multiarch and -imultilib.
	* config.gcc  (tmake_file):
	Include i386/t-linux.
	 (tmake_file):
	Include i386/t-kfreebsd.
	 (tmake_file): Include i386/t-gnu.
	* config/i386/t-linux64: Add multiarch names in
	MULTILIB_OSDIRNAMES, define MULTIARCH_DIRNAME.
	* config/i386/t-gnu: New file.
	* config/i386/t-kfreebsd: Likewise.
	* config/i386/t-linux: Likewise.


Index: doc/invoke.texi
===
--- doc/invoke.texi	(revision 193133)
+++ doc/invoke.texi	(working copy)
@@ -6309,6 +6309,11 @@
 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
 
+@item -print-multiarch
+@opindex print-multiarch
+Print the path to OS libraries for the selected multiarch,
+relative to some @file{lib} subdirectory.
+
 @item -print-prog-name=@var{program}
 @opindex print-prog-name
 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
Index: doc/install.texi
===

Re: [ping] Re: [patch v2] support for multiarch systems

2012-11-02 Thread Ian Lance Taylor
On Fri, Nov 2, 2012 at 6:26 AM, Matthias Klose  wrote:
>
>> +ifeq ($(enable_multiarch),yes)
>> +  if_multiarch = $(1)
>> +else ifeq ($(enable_multiarch),auto-detect)
>> +  if_multiarch = $(if $(wildcard $(shell echo
>> $(SYSTEM_HEADER_DIR))/../../usr/lib/*/crti.o),$(1))
>> +else
>> +  if_multiarch =
>> +endif
>>
>> This is nicely tricky but I don't understand why you are doing this in
>> such a confusing way.  Why not simply set the names in config.gcc?
>> What information do you have at make time that you don't have at
>> configure time?
>
>
> this is for the auto case. SYSTEM_HEADER_DIR is not accessible/available
> from
> config.gcc. This is the same approach as taken for MULTILIB_OSDDIRNAMES.
> Also setting the names for the multiarch directories in the same place as
> done for for the MULTILIB_OSDIRNAMES seems to be better choice.

SYSTEM_HEADER_DIR is available in gcc/configure.ac, and you could do
the $(if $(wildcard $(shell echo
>> $(SYSTEM_HEADER_DIR))/../../usr/lib/*/crti.o) there.  I can't see any reason 
>> to do it at make time rather than configure time.

> +   if (*q2 == ':')
> + end = q2;

Don't reuse end here.  Use a new variable.

Please update the comment for set_multilib_dir.  It's not a very good
comment, but it does describe the syntax, and you seem to be changing
the syntax.

> -  if (this_path[0] == '.' && this_path[1] == ':')
> +  if (this_path[0] == '.' && this_path[1] == ':' && this_path[2] != ':')

The existing comment here is reasonably clear.  Please update the
comment to show why this change is correct.

> +Specify wether to enable or disable multiarch support.  The default is

s/wether/whether/

> +to detect for glibc start files in a multiarch location, and enable it

s/detect/check/ or something along those lines.

Ian


Re: [ping] Re: [patch v2] support for multiarch systems

2012-11-02 Thread Matthias Klose

On 07.08.2012 16:07, Ian Lance Taylor wrote:

On Tue, Aug 7, 2012 at 3:31 AM, Matthias Klose  wrote:

ping?

On 08.07.2012 20:48, Matthias Klose wrote:

Please find attached v2 of the patch updated for trunk 20120706, x86 only, 
tested on
x86-linux-gnu, KFreeBSD and the Hurd.



+[case "${withval}" in
+yes|no|auto-detect) enable_multiarch=$withval;;
+*) AC_MSG_ERROR(bad value ${withval} given for --enable-multiarch option) ;;


Please just use "auto", not "auto-detect", as in libgcc/configure.ac.


ok.


+# needed for setting the multiarch name on ARM
+AC_SUBST(with_float)


This seems like it should be in a different patch.


+with_float = @with_float@


Likewise.


I was asked to split the ix86 and infrastructure bits from the bits for all
other architectures. I think it does belong here. The with_float macro is then
used for e.g. ARM to distinguish between hard and soft float triplets.


+ifeq ($(enable_multiarch),yes)
+  if_multiarch = $(1)
+else ifeq ($(enable_multiarch),auto-detect)
+  if_multiarch = $(if $(wildcard $(shell echo
$(SYSTEM_HEADER_DIR))/../../usr/lib/*/crti.o),$(1))
+else
+  if_multiarch =
+endif

This is nicely tricky but I don't understand why you are doing this in
such a confusing way.  Why not simply set the names in config.gcc?
What information do you have at make time that you don't have at
configure time?


this is for the auto case. SYSTEM_HEADER_DIR is not accessible/available from
config.gcc. This is the same approach as taken for MULTILIB_OSDDIRNAMES. Also 
setting the names for the multiarch directories in the same place as done for 
for the MULTILIB_OSDIRNAMES seems to be better choice.



The auto case is not general.  When cross-compiling without --sysroot,
or when using --native-system-header-dir, the test won't work.
Without --sysroot there may not be much that you can do to auto-detect
multiarch.  And with --sysroot, there should be no need to use
SYSTEM_HEADER_DIR at all; just look in the sysroot.


+@item --enable-multiarch
+Specify wether to enable or disable multiarch support.  The default is
+to detect for glibc start files in a multiarch location, and enable it
+if the files are found.


This is quite obscure for anybody who does not already know what multiarch is.


I did add the pointer to multiarch, which already is in fragments.texi:

  More documentation about multiarch can be found at
  @uref{http://wiki.debian.org/Multiarch}.

The feedback about what and where information about multiarch should be added, 
changes from reviewer to reviewer.


Attaching the updated patch.


I'm sorry, I have to repeat my extreme annoyance that this scheme
breaks all earlier GCC releases.


yes, this is mentioned at http://bugs.debian.org/637232 too. I proposed a patch 
to add a libc6-dev-compat binary package which can be installed together with 
the existing libc6-dev packages.


  Matthias
2012-11-02  Matthias Klose  

	* doc/invoke.texi: Document -print-multiarch.
	* doc/install.texi: Document --enable-multiarch.
	* doc/fragments.texi: Document MULTILIB_OSDIRNAMES, MULTIARCH_DIRNAME.
	* configure.ac: Add --enable-multiarch option.
	* configure: Regenerate.
	* Makefile.in (s-mlib): Pass MULTIARCH_DIRNAME to genmultilib.
	enable_multiarch, with_float: New macros.
	if_multiarch: New macro, define in terms of enable_multiarch.
	* genmultilib: Add new argument for the multiarch name.
	* gcc.c (multiarch_dir): Define.
	(for_each_path): Search for multiarch suffixes.
	(driver_handle_option): Handle multiarch option.
	(do_spec_1): Pass -imultiarch if defined.
	(main): Print multiarch.
	(set_multilib_dir): Separate multilib and multiarch names
	from multilib_select.
	(print_multilib_info): Ignore multiarch names in multilib_select.
	* incpath.c (add_standard_paths): Search the multiarch include dirs.
	* cppdeault.h (default_include): Document multiarch in multilib
	member.
	* cppdefault.c: [LOCAL_INCLUDE_DIR, STANDARD_INCLUDE_DIR] Add an
include directory for multiarch directories.
	* common.opt: New options --print-multiarch and -imultilib.
	* config.gcc  (tmake_file):
	Include i386/t-linux.
	 (tmake_file):
	Include i386/t-kfreebsd.
	 (tmake_file): Include i386/t-gnu.
	* config/i386/t-linux64: Add multiarch names in
	MULTILIB_OSDIRNAMES, define MULTIARCH_DIRNAME.
	* config/i386/t-gnu: New file.
	* config/i386/t-kfreebsd: Likewise.
	* config/i386/t-linux: Likewise.


Index: gcc/config/i386/t-linux64
===
--- gcc/config/i386/t-linux64	(revision 193062)
+++ gcc/config/i386/t-linux64	(working copy)
@@ -34,6 +34,6 @@
 comma=,
 MULTILIB_OPTIONS= $(subst $(comma),/,$(TM_MULTILIB_CONFIG))
 MULTILIB_DIRNAMES   = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS)))
-MULTILIB_OSDIRNAMES = m64=../lib64
-MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)
-MULTILIB_OSDIRNAMES+= mx32=../libx32
+MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-

Re: [ping] Re: [patch v2] support for multiarch systems

2012-08-07 Thread Ian Lance Taylor
On Tue, Aug 7, 2012 at 3:31 AM, Matthias Klose  wrote:
> ping?
>
> On 08.07.2012 20:48, Matthias Klose wrote:
>> Please find attached v2 of the patch updated for trunk 20120706, x86 only, 
>> tested on
>> x86-linux-gnu, KFreeBSD and the Hurd.

> +[case "${withval}" in
> +yes|no|auto-detect) enable_multiarch=$withval;;
> +*) AC_MSG_ERROR(bad value ${withval} given for --enable-multiarch option) ;;

Please just use "auto", not "auto-detect", as in libgcc/configure.ac.

> +# needed for setting the multiarch name on ARM
> +AC_SUBST(with_float)

This seems like it should be in a different patch.

> +with_float = @with_float@

Likewise.

+ifeq ($(enable_multiarch),yes)
+  if_multiarch = $(1)
+else ifeq ($(enable_multiarch),auto-detect)
+  if_multiarch = $(if $(wildcard $(shell echo
$(SYSTEM_HEADER_DIR))/../../usr/lib/*/crti.o),$(1))
+else
+  if_multiarch =
+endif

This is nicely tricky but I don't understand why you are doing this in
such a confusing way.  Why not simply set the names in config.gcc?
What information do you have at make time that you don't have at
configure time?

The auto case is not general.  When cross-compiling without --sysroot,
or when using --native-system-header-dir, the test won't work.
Without --sysroot there may not be much that you can do to auto-detect
multiarch.  And with --sysroot, there should be no need to use
SYSTEM_HEADER_DIR at all; just look in the sysroot.

> +@item --enable-multiarch
> +Specify wether to enable or disable multiarch support.  The default is
> +to detect for glibc start files in a multiarch location, and enable it
> +if the files are found.

This is quite obscure for anybody who does not already know what multiarch is.

I'm sorry, I have to repeat my extreme annoyance that this scheme
breaks all earlier GCC releases.

Ian


[ping] Re: [patch v2] support for multiarch systems

2012-08-07 Thread Matthias Klose
ping?

re-attaching the updated patch with the fixed comment in genmultilib.

  Matthias

On 08.07.2012 20:48, Matthias Klose wrote:
> Please find attached v2 of the patch updated for trunk 20120706, x86 only, 
> tested on
> x86-linux-gnu, KFreeBSD and the Hurd.
> 
> I left in the comment about the multiarch names, but I'm fine to 
> change/discard
> it. It was first required by Joseph Myers, then not found necessary by Paolo
> Bonzini. The patch includes the changes suggested by Thomas Schwinge.
> 
> Ok for the trunk?
> 
>   Matthias
> 

2012-06-25  Matthias Klose  

* doc/invoke.texi: Document -print-multiarch.
* doc/install.texi: Document --enable-multiarch.
* doc/fragments.texi: Document MULTILIB_OSDIRNAMES, MULTIARCH_DIRNAME.
* configure.ac: Add --enable-multiarch option.
* configure.in: Regenerate.
* Makefile.in (s-mlib): Pass MULTIARCH_DIRNAME to genmultilib.
enable_multiarch, with_float: New macros.
if_multiarch: New macro, define in terms of enable_multiarch.
* genmultilib: Add new argument for the multiarch name.
* gcc.c (multiarch_dir): Define.
(for_each_path): Search for multiarch suffixes.
(driver_handle_option): Handle multiarch option.
(do_spec_1): Pass -imultiarch if defined.
(main): Print multiarch.
(set_multilib_dir): Separate multilib and multiarch names
from multilib_select.
(print_multilib_info): Ignore multiarch names in multilib_select.
* incpath.c (add_standard_paths): Search the multiarch include dirs.
* cppdeault.h (default_include): Document multiarch in multilib
member.
* cppdefault.c: [LOCAL_INCLUDE_DIR, STANDARD_INCLUDE_DIR] Add an
include directory for multiarch directories.
* common.opt: New options --print-multiarch and -imultilib.
* config.gcc  (tmake_file):
Include i386/t-linux.
 (tmake_file):
Include i386/t-kfreebsd.
 (tmake_file): Include i386/t-gnu.
* config/i386/t-linux64: Add multiarch names in
MULTILIB_OSDIRNAMES, define MULTIARCH_DIRNAME.
* config/i386/t-gnu: New file.
* config/i386/t-kfreebsd: Likewise.
* config/i386/t-linux: Likewise.


Index: configure.ac
===
--- configure.ac(revision 188931)
+++ configure.ac(working copy)
@@ -623,6 +623,21 @@
 [], [enable_multilib=yes])
 AC_SUBST(enable_multilib)
 
+# Determine whether or not multiarch is enabled.
+AC_ARG_ENABLE(multiarch,
+[AS_HELP_STRING([--enable-multiarch],
+   [enable support for multiarch paths])],
+[case "${withval}" in
+yes|no|auto-detect) enable_multiarch=$withval;;
+*) AC_MSG_ERROR(bad value ${withval} given for --enable-multiarch option) ;;
+esac], [enable_multiarch=auto-detect])
+AC_MSG_CHECKING(for multiarch configuration)
+AC_SUBST(enable_multiarch)
+AC_MSG_RESULT($enable_multiarch)
+
+# needed for setting the multiarch name on ARM
+AC_SUBST(with_float)
+
 # Enable __cxa_atexit for C++.
 AC_ARG_ENABLE(__cxa_atexit,
 [AS_HELP_STRING([--enable-__cxa_atexit], [enable __cxa_atexit for C++])],
Index: cppdefault.c
===
--- cppdefault.c(revision 188931)
+++ cppdefault.c(working copy)
@@ -63,6 +63,7 @@
 #endif
 #ifdef LOCAL_INCLUDE_DIR
 /* /usr/local/include comes before the fixincluded header files.  */
+{ LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 },
 { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 },
 #endif
 #ifdef PREFIX_INCLUDE_DIR
@@ -90,6 +91,7 @@
 #endif
 #ifdef NATIVE_SYSTEM_HEADER_DIR
 /* /usr/include comes dead last.  */
+{ NATIVE_SYSTEM_HEADER_DIR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 2 },
 { NATIVE_SYSTEM_HEADER_DIR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 0 },
 #endif
 { 0, 0, 0, 0, 0, 0 }
Index: cppdefault.h
===
--- cppdefault.h(revision 188931)
+++ cppdefault.h(working copy)
@@ -43,9 +43,11 @@
   C++.  */
   const char add_sysroot;  /* FNAME should be prefixed by
   cpp_SYSROOT.  */
-  const char multilib; /* FNAME should have the multilib path
-  specified with -imultilib
-  appended.  */
+  const char multilib; /* FNAME should have appended
+  - the multilib path specified with -imultilib
+when 1 is passed,
+  - the multiarch path specified with
+-imultiarch, when 2 is passed.  */
 };
 
 extern const struct default_include cpp_include_defaults[];
Index: Makefile.in
===
--- Makefile.in (revision 188931)
+++ Makefile.in (working cop

Re: [patch v2] support for multiarch systems

2012-07-19 Thread Joseph S. Myers
On Wed, 18 Jul 2012, John David Anglin wrote:

> It would make my life easier if the change included the multiarch bits for
> hppa.  I imagine other Debian ports are in a similar situation.

I explained at length in reviews of previous patch versions how each 
architecture needs its own review to make sure that the changes for that 
architecture won't end up using an inappropriate multiarch name for some 
configure options, and thus it's best to get the basic support in first 
then handle each architecture individually with a separate patch.

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


Re: [patch v2] support for multiarch systems

2012-07-18 Thread David Miller
From: John David Anglin 
Date: Wed, 18 Jul 2012 21:12:26 -0400

> I imagine other Debian ports are in a similar situation.

GCC hacking has been extremely painful on sparc for me because of this
debian multiarch situation, so yes I'm in this group as well.


Re: [patch v2] support for multiarch systems

2012-07-18 Thread John David Anglin
On Sun, 08 Jul 2012, Matthias Klose wrote:

> Please find attached v2 of the patch updated for trunk 20120706, x86 only, 
> tested on
> x86-linux-gnu, KFreeBSD and the Hurd.

Currently, Debian gcc packages for hppa contain multiarch support.  Because
of this, I have used a multiarch patch for testing Debian Linux for hppa for
a long time.  My test system is multiarch.

It would make my life easier if the change included the multiarch bits for
hppa.  I imagine other Debian ports are in a similar situation.

Dave
-- 
J. David Anglin  dave.ang...@nrc-cnrc.gc.ca
National Research Council of Canada  (613) 990-0752 (FAX: 952-6602)


Re: [patch v2] support for multiarch systems

2012-07-18 Thread Thomas Schwinge
Hi!

On Sun, 08 Jul 2012 20:48:23 +0200, Matthias Klose  wrote:
> Please find attached v2 of the patch updated for trunk 20120706, x86 only, 
> tested on
> x86-linux-gnu, KFreeBSD and the Hurd.

As suggested by Diego Novillo I have now attached this patch to
.

> I left in the comment about the multiarch names, but I'm fine to 
> change/discard
> it. It was first required by Joseph Myers, then not found necessary by Paolo
> Bonzini. The patch includes the changes suggested by Thomas Schwinge.

I'm confirming that this version of that patch is identical to the patch
that I have been using "ever since", only this current one includes
additional documentation changes, and the s%eight%ninth documentation
change is missing from gcc/genmultilib.

> Ok for the trunk?
> 
>   Matthias
> 2012-06-25  Matthias Klose  
> 
>   * doc/invoke.texi: Document -print-multiarch.
>   * doc/install.texi: Document --enable-multiarch.
>   * doc/fragments.texi: Document MULTILIB_OSDIRNAMES, MULTIARCH_DIRNAME.
>   * configure.ac: Add --enable-multiarch option.
>   * configure.in: Regenerate.
>   * Makefile.in (s-mlib): Pass MULTIARCH_DIRNAME to genmultilib.
>   enable_multiarch, with_float: New macros.
>   if_multiarch: New macro, define in terms of enable_multiarch.
>   * genmultilib: Add new argument for the multiarch name.
>   * gcc.c (multiarch_dir): Define.
>   (for_each_path): Search for multiarch suffixes.
>   (driver_handle_option): Handle multiarch option.
>   (do_spec_1): Pass -imultiarch if defined.
>   (main): Print multiarch.
>   (set_multilib_dir): Separate multilib and multiarch names
>   from multilib_select.
>   (print_multilib_info): Ignore multiarch names in multilib_select.
>   * incpath.c (add_standard_paths): Search the multiarch include dirs.
>   * cppdeault.h (default_include): Document multiarch in multilib
>   member.
>   * cppdefault.c: [LOCAL_INCLUDE_DIR, STANDARD_INCLUDE_DIR] Add an
> include directory for multiarch directories.
>   * common.opt: New options --print-multiarch and -imultilib.
>   * config.gcc  (tmake_file):
>   Include i386/t-linux.
>(tmake_file):
>   Include i386/t-kfreebsd.
>(tmake_file): Include i386/t-gnu.
>   * config/i386/t-linux64: Add multiarch names in
>   MULTILIB_OSDIRNAMES, define MULTIARCH_DIRNAME.
>   * config/i386/t-gnu: New file.
>   * config/i386/t-kfreebsd: Likewise.
>   * config/i386/t-linux: Likewise.


Grüße,
 Thomas


pgpvUbsKmY0A9.pgp
Description: PGP signature


Re: [patch v2] support for multiarch systems

2012-07-08 Thread Matthias Klose
Please find attached v2 of the patch updated for trunk 20120706, x86 only, 
tested on
x86-linux-gnu, KFreeBSD and the Hurd.

I left in the comment about the multiarch names, but I'm fine to change/discard
it. It was first required by Joseph Myers, then not found necessary by Paolo
Bonzini. The patch includes the changes suggested by Thomas Schwinge.

Ok for the trunk?

  Matthias
2012-06-25  Matthias Klose  

* doc/invoke.texi: Document -print-multiarch.
* doc/install.texi: Document --enable-multiarch.
* doc/fragments.texi: Document MULTILIB_OSDIRNAMES, MULTIARCH_DIRNAME.
* configure.ac: Add --enable-multiarch option.
* configure.in: Regenerate.
* Makefile.in (s-mlib): Pass MULTIARCH_DIRNAME to genmultilib.
enable_multiarch, with_float: New macros.
if_multiarch: New macro, define in terms of enable_multiarch.
* genmultilib: Add new argument for the multiarch name.
* gcc.c (multiarch_dir): Define.
(for_each_path): Search for multiarch suffixes.
(driver_handle_option): Handle multiarch option.
(do_spec_1): Pass -imultiarch if defined.
(main): Print multiarch.
(set_multilib_dir): Separate multilib and multiarch names
from multilib_select.
(print_multilib_info): Ignore multiarch names in multilib_select.
* incpath.c (add_standard_paths): Search the multiarch include dirs.
* cppdeault.h (default_include): Document multiarch in multilib
member.
* cppdefault.c: [LOCAL_INCLUDE_DIR, STANDARD_INCLUDE_DIR] Add an
include directory for multiarch directories.
* common.opt: New options --print-multiarch and -imultilib.
* config.gcc  (tmake_file):
Include i386/t-linux.
 (tmake_file):
Include i386/t-kfreebsd.
 (tmake_file): Include i386/t-gnu.
* config/i386/t-linux64: Add multiarch names in
MULTILIB_OSDIRNAMES, define MULTIARCH_DIRNAME.
* config/i386/t-gnu: New file.
* config/i386/t-kfreebsd: Likewise.
* config/i386/t-linux: Likewise.


Index: configure.ac
===
--- configure.ac(revision 188931)
+++ configure.ac(working copy)
@@ -623,6 +623,21 @@
 [], [enable_multilib=yes])
 AC_SUBST(enable_multilib)
 
+# Determine whether or not multiarch is enabled.
+AC_ARG_ENABLE(multiarch,
+[AS_HELP_STRING([--enable-multiarch],
+   [enable support for multiarch paths])],
+[case "${withval}" in
+yes|no|auto-detect) enable_multiarch=$withval;;
+*) AC_MSG_ERROR(bad value ${withval} given for --enable-multiarch option) ;;
+esac], [enable_multiarch=auto-detect])
+AC_MSG_CHECKING(for multiarch configuration)
+AC_SUBST(enable_multiarch)
+AC_MSG_RESULT($enable_multiarch)
+
+# needed for setting the multiarch name on ARM
+AC_SUBST(with_float)
+
 # Enable __cxa_atexit for C++.
 AC_ARG_ENABLE(__cxa_atexit,
 [AS_HELP_STRING([--enable-__cxa_atexit], [enable __cxa_atexit for C++])],
Index: cppdefault.c
===
--- cppdefault.c(revision 188931)
+++ cppdefault.c(working copy)
@@ -63,6 +63,7 @@
 #endif
 #ifdef LOCAL_INCLUDE_DIR
 /* /usr/local/include comes before the fixincluded header files.  */
+{ LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 },
 { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 },
 #endif
 #ifdef PREFIX_INCLUDE_DIR
@@ -90,6 +91,7 @@
 #endif
 #ifdef NATIVE_SYSTEM_HEADER_DIR
 /* /usr/include comes dead last.  */
+{ NATIVE_SYSTEM_HEADER_DIR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 2 },
 { NATIVE_SYSTEM_HEADER_DIR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 0 },
 #endif
 { 0, 0, 0, 0, 0, 0 }
Index: cppdefault.h
===
--- cppdefault.h(revision 188931)
+++ cppdefault.h(working copy)
@@ -43,9 +43,11 @@
   C++.  */
   const char add_sysroot;  /* FNAME should be prefixed by
   cpp_SYSROOT.  */
-  const char multilib; /* FNAME should have the multilib path
-  specified with -imultilib
-  appended.  */
+  const char multilib; /* FNAME should have appended
+  - the multilib path specified with -imultilib
+when 1 is passed,
+  - the multiarch path specified with
+-imultiarch, when 2 is passed.  */
 };
 
 extern const struct default_include cpp_include_defaults[];
Index: Makefile.in
===
--- Makefile.in (revision 188931)
+++ Makefile.in (working copy)
@@ -350,6 +350,17 @@
 
 enable_plugin = @enable_plugin@
 
+# Multiarch support
+enable_multiarch = @enable_multiarch@
+with_float = @with_float@
+ifeq ($(enabl