public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
* Avoid $(shell) in determining default ARM ABI
@ 2012-11-21 21:08 Joseph S. Myers
  2012-11-21 21:37 ` Roland McGrath
  0 siblings, 1 reply; 4+ messages in thread
From: Joseph S. Myers @ 2012-11-21 21:08 UTC (permalink / raw)
  To: libc-ports

I've applied this patch to avoid use of $(shell) when determining the 
default ARM ABI, instead generating a makefile fragment from the configure 
scripts, as previously requested by Roland.  (I put the relevant code in 
the configure fragment with the existing test for the ARM ABI, although 
the only user is the Linux-specific makefile.  That existing code is in 
fact only for the benefit of the shlib-versions file, which is in 
sysdeps/arm/shlib-versions although almost all the ports shlib-versions 
files are in fact Linux-specific despite their sysdeps locations.)

2012-11-21  Joseph Myers  <joseph@codesourcery.com>

	* sysdeps/arm/configure.in: Generate default-abi.make with
	definition of default-abi.
	* sysdeps/arm/configure: Regenerated.
	* sysdeps/unix/sysv/linux/arm/Makefile (default-abi-prog): Remove.
	(default-abi): Likewise.
	($(common-objpfx)default-abi.make): Include.

diff --git a/ports/sysdeps/arm/configure b/ports/sysdeps/arm/configure
index 385f295..91239cd 100644
--- a/ports/sysdeps/arm/configure
+++ b/ports/sysdeps/arm/configure
@@ -197,4 +197,7 @@ $as_echo "$libc_cv_arm_pcs_vfp" >&6; }
 if test $libc_cv_arm_pcs_vfp = yes; then
   $as_echo "#define HAVE_ARM_PCS_VFP 1" >>confdefs.h
 
+  echo "default-abi := hard" > default-abi.make
+else
+  echo "default-abi := soft" > default-abi.make
 fi
diff --git a/ports/sysdeps/arm/configure.in b/ports/sysdeps/arm/configure.in
index 7e91332..6073d0e 100644
--- a/ports/sysdeps/arm/configure.in
+++ b/ports/sysdeps/arm/configure.in
@@ -40,4 +40,7 @@ AC_CACHE_CHECK([whether the compiler is using the ARM hard-float ABI],
   ], libc_cv_arm_pcs_vfp=yes, libc_cv_arm_pcs_vfp=no)])
 if test $libc_cv_arm_pcs_vfp = yes; then
   AC_DEFINE(HAVE_ARM_PCS_VFP)
+  echo "default-abi := hard" > default-abi.make
+else
+  echo "default-abi := soft" > default-abi.make
 fi
diff --git a/ports/sysdeps/unix/sysv/linux/arm/Makefile b/ports/sysdeps/unix/sysv/linux/arm/Makefile
index bda3ea9..be7946e 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/Makefile
+++ b/ports/sysdeps/unix/sysv/linux/arm/Makefile
@@ -70,25 +70,16 @@ LDFLAGS-tst-rfc3484-2 += $(common-objpfx)csu/libc-do-syscall.o
 LDFLAGS-tst-rfc3484-3 += $(common-objpfx)csu/libc-do-syscall.o
 endif
 
-define default-abi-prog
-echo '#ifdef __ARM_PCS_VFP';
-echo 'hard';
-echo '#else';
-echo 'soft';
-echo '#endif'
-endef
-default-abi := $(strip $(shell \
-    ($(default-abi-prog)) | $(CC) $(CFLAGS) $(CPPFLAGS) -E -P -))
-ifeq ($(default-abi),hard)
-# OK.
-else
-ifneq ($(default-abi),soft)
-Unknown ABI, must be "hard" or "soft".
-endif
+# Get value of default-abi.
+include $(common-objpfx)default-abi.make
+
+abi-variants := soft hard
+
+ifeq (,$(filter $(default-abi),$(abi-variants)))
+Unknown ABI, must be one of $(abi-variants)
 endif
 
 abi-includes :=
-abi-variants := soft hard
 abi-soft-options := -U__ARM_PCS_VFP
 abi-soft-condition := !defined __ARM_PCS_VFP
 abi-soft-ld-soname := ld-linux.so.3

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: Avoid $(shell) in determining default ARM ABI
  2012-11-21 21:08 Avoid $(shell) in determining default ARM ABI Joseph S. Myers
@ 2012-11-21 21:37 ` Roland McGrath
  2012-11-21 22:05   ` Joseph S. Myers
  0 siblings, 1 reply; 4+ messages in thread
From: Roland McGrath @ 2012-11-21 21:37 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: libc-ports

> --- a/ports/sysdeps/arm/configure.in
> +++ b/ports/sysdeps/arm/configure.in
> @@ -40,4 +40,7 @@ AC_CACHE_CHECK([whether the compiler is using the ARM hard-float ABI],
>    ], libc_cv_arm_pcs_vfp=yes, libc_cv_arm_pcs_vfp=no)])
>  if test $libc_cv_arm_pcs_vfp = yes; then
>    AC_DEFINE(HAVE_ARM_PCS_VFP)
> +  echo "default-abi := hard" > default-abi.make
> +else
> +  echo "default-abi := soft" > default-abi.make

That's not right.  You need to use autoconf machinery for this so that
./config.status will recreate the file.  But actually you can just append
to config_vars in the fragment and then the main configure's
AC_CONFIG_COMMANDS will add your lines to config.make, which is even easier.


Thanks,
Roland

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

* Re: Avoid $(shell) in determining default ARM ABI
  2012-11-21 21:37 ` Roland McGrath
@ 2012-11-21 22:05   ` Joseph S. Myers
  2012-11-21 22:09     ` Roland McGrath
  0 siblings, 1 reply; 4+ messages in thread
From: Joseph S. Myers @ 2012-11-21 22:05 UTC (permalink / raw)
  To: Roland McGrath; +Cc: libc-ports

On Wed, 21 Nov 2012, Roland McGrath wrote:

> > --- a/ports/sysdeps/arm/configure.in
> > +++ b/ports/sysdeps/arm/configure.in
> > @@ -40,4 +40,7 @@ AC_CACHE_CHECK([whether the compiler is using the ARM hard-float ABI],
> >    ], libc_cv_arm_pcs_vfp=yes, libc_cv_arm_pcs_vfp=no)])
> >  if test $libc_cv_arm_pcs_vfp = yes; then
> >    AC_DEFINE(HAVE_ARM_PCS_VFP)
> > +  echo "default-abi := hard" > default-abi.make
> > +else
> > +  echo "default-abi := soft" > default-abi.make
> 
> That's not right.  You need to use autoconf machinery for this so that

It's essentially the same as used for MIPS.

> ./config.status will recreate the file.  But actually you can just append

In any case where the contents might change, a full reconfiguration in a 
clean build directory is required anyway (it's essentially the same as 
configuring for a different target).

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: Avoid $(shell) in determining default ARM ABI
  2012-11-21 22:05   ` Joseph S. Myers
@ 2012-11-21 22:09     ` Roland McGrath
  0 siblings, 0 replies; 4+ messages in thread
From: Roland McGrath @ 2012-11-21 22:09 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: libc-ports

> It's essentially the same as used for MIPS.

Then both are wrong.

> > ./config.status will recreate the file.  But actually you can just append
> 
> In any case where the contents might change, [...]

This criterion is irrelevant to the problem, which is a straightforward
violation of GNU configure standards.  You should be able to blow away the
entire build directory save config.status, run ./config.status (without
--recheck) and be ready to run 'make' just like you had run configure from
scratch.  I'm not aware of anything in the generic libc build code that
would prevent this.


Thanks,
Roland

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

end of thread, other threads:[~2012-11-21 22:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-21 21:08 Avoid $(shell) in determining default ARM ABI Joseph S. Myers
2012-11-21 21:37 ` Roland McGrath
2012-11-21 22:05   ` Joseph S. Myers
2012-11-21 22:09     ` Roland McGrath

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).