public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] configury : Fix LEB128 support for non-GNU assemblers.
@ 2020-11-25  9:49 Iain Sandoe
  2020-11-25 10:37 ` Rainer Orth
  2020-11-25 17:49 ` Jeff Law
  0 siblings, 2 replies; 15+ messages in thread
From: Iain Sandoe @ 2020-11-25  9:49 UTC (permalink / raw)
  To: GCC Patches; +Cc: David Edelsohn, Andrew Stubbs, Rainer Orth

Hi,

I’ve had this patch in my Darwin trees for (literally) years, it is  
relevant to
the GCC ports that use a non-binutils assembler.

At present, even if such an assembler supports LEB128,  the GCC config
is setting HAVE_LEB128 = 0.

The ports I know of that can benefit from a change here are:

AIX (unaffected by this change, since the assembler [at least on gcc119] does
         not support leb128 directives)

Darwin (checked the various different assemblers)

GCN (I can’t test this, so Andrew, please could you say if the change
           is OK for that)

Solaris (bootstrapped and tests running on GCC211, but maybe Rainer would
             want wider checks).

I guess we could exclude specific ports that don’t want to use leb128 with
a target elif in the configuration.

OK for master?

thanks
Iain

===== commit message

Some assemblers that either do not respond to --version, or are non-GNU,
do support leb128 directives.  The current configuration test omits these
cases and only supports GNU assemblers with a version > 2.11.

The patch extends the asm test to cover one failure case present in
assemblers based off an older version of GAS (where a 64 bit value with
the MSB set presented to a .uleb128 directive causes a fail).

This change then assumes that a non-GNU assembler that passes the asm test
correctly supports the directives.

gcc/ChangeLog:

	* configure.ac (check leb128 support): Support non-GNU assemblers
	that pass the leb128 confgure test.  Add a test for uleb128 with
	the MSB set for a 64 bit value.
	* configure: Regenerated.
---
  gcc/configure    | 6 ++++++
  gcc/configure.ac | 6 ++++++
  2 files changed, 12 insertions(+)

diff --git a/gcc/configure.ac b/gcc/configure.ac
index b410428b4fc..8a1aa95f01b 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -3072,6 +3072,8 @@ AC_MSG_RESULT($gcc_cv_ld_ro_rw_mix)
  gcc_AC_INITFINI_ARRAY
 
  # Check if we have .[us]leb128, and support symbol arithmetic with it.
+# Some assemblers based on older GAS have a bug when the MSB is set for
+# a 64b value and used in a uleb128.
  gcc_GAS_CHECK_FEATURE([.sleb128 and .uleb128], gcc_cv_as_leb128,
    [elf,2,11,0],,
  [	.data
@@ -3079,6 +3081,7 @@ gcc_GAS_CHECK_FEATURE([.sleb128 and .uleb128],  
gcc_cv_as_leb128,
  L1:
  	.uleb128 1280
  	.sleb128 -1010
+	.uleb128 0x8000000000000000
  L2:],
  [[# GAS versions before 2.11 do not support uleb128,
    # despite appearing to.
@@ -3095,6 +3098,9 @@ L2:],
      then :
      else gcc_cv_as_leb128=yes
      fi
+  else
+    # This is a non-GNU assembler, which passes the feature check.
+    gcc_cv_as_leb128=yes
    fi]],
    [AC_DEFINE(HAVE_AS_LEB128, 1,
      [Define if your assembler supports .sleb128 and .uleb128.])],
-- 
2.24.1


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

end of thread, other threads:[~2020-11-27 10:37 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-25  9:49 [PATCH] configury : Fix LEB128 support for non-GNU assemblers Iain Sandoe
2020-11-25 10:37 ` Rainer Orth
2020-11-26 13:08   ` Rainer Orth
2020-11-26 13:17     ` Iain Sandoe
2020-11-26 13:26       ` Rainer Orth
2020-11-26 13:30         ` Jakub Jelinek
2020-11-26 15:07           ` Rainer Orth
2020-11-26 20:28             ` Iain Sandoe
2020-11-26 21:39               ` Rainer Orth
2020-11-26 21:43                 ` Iain Sandoe
2020-11-27 10:29                   ` [PATCH v2] " Iain Sandoe
2020-11-27 10:37                     ` Jakub Jelinek
2020-11-26 14:48         ` [PATCH] " Iain Sandoe
2020-11-26 14:52           ` Andrew Stubbs
2020-11-25 17:49 ` Jeff Law

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