public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Kai Tietz <Kai.Tietz@onevision.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: binutils@sources.redhat.com, "H. J. Lu" <hjl@lucon.org>
Subject: Re: PATCH: w64 native support
Date: Wed, 11 Apr 2007 15:24:00 -0000	[thread overview]
Message-ID: <OF44FF5A09.150B707F-ONC12572BA.005355F1-C12572BA.0054580A@onevision.de> (raw)
In-Reply-To: <20070411150031.GB21844@caradoc.them.org>

[-- Attachment #1: Type: text/plain, Size: 1506 bytes --]

Daniel Jacobowitz <drow@false.org> wrote on 11.04.2007 17:00:31:

> On Wed, Apr 11, 2007 at 04:17:40PM +0200, Kai Tietz wrote:
> > The "long long" would work, if there would not be the -Werror 
parameter 
> > for gcc. The gcc bubbles a warning also for the case, that the integer 

> > casted to/from a pointer is bigger :(. This would break an cross from 
> > 32-bit to 64-bit.
> 
> We already have an autoconf macro in the tree to generate a stdint.h.
> Gnulib also has one that we can import.
> 
> It's long past time to start assuming intptr_t.

Yes, ice ages ... It seems that on every project and library the same old 
story reappears ;)
But as I learned, not on every c-runtime necessarily an stdint header is 
present and/or want to be included ;()

Re-inventing the wheel, may this patch could work (beside the 
BFD_HOSTPTR_T_PRT_X).

Regards,
i.A. Kai Tietz

 


------------------------------------------------------------------------------------------
  OneVision Software Entwicklungs GmbH & Co. KG
  Dr.-Leo-Ritter-Straße 9 - 93049 Regensburg
  Tel: +49.(0)941.78004.0 - Fax: +49.(0)941.78004.489 - www.OneVision.com
  Commerzbank Regensburg - BLZ 750 400 62 - Konto 6011050
  Handelsregister: HRA 6744, Amtsgericht Regensburg
  Komplementärin: OneVision Software Entwicklungs Verwaltungs GmbH
  Dr.-Leo-Ritter-Straße 9 – 93049 Regensburg
  Handelsregister: HRB 8932, Amtsgericht Regensburg - Geschäftsführer: 
Ulrike Döhler, Manuela Kluger



[-- Attachment #2: bfd_config.txt --]
[-- Type: text/plain, Size: 2997 bytes --]

Index: configure.in
===================================================================
RCS file: /cvs/src/src/bfd/configure.in,v
retrieving revision 1.226
diff -b -u -r1.226 configure.in
--- configure.in	23 Mar 2007 02:51:30 -0000	1.226
+++ configure.in	11 Apr 2007 15:15:56 -0000
@@ -99,6 +99,7 @@
 AC_PROG_INSTALL
 
 BFD_HOST_64BIT_LONG=0
+BFD_HOST_64BIT_LONG_LONG=0
 BFD_HOST_LONG_LONG=0
 BFD_HOST_64_BIT_DEFINED=0
 BFD_HOST_64_BIT=
@@ -114,11 +115,20 @@
 fi
 
 AC_CHECK_SIZEOF(long)
+AC_CHECK_SIZEOF(void *)
 if test "x${ac_cv_sizeof_long}" = "x8"; then
   host64=true
   BFD_HOST_64BIT_LONG=1
+  if test "x${ac_cv_sizeof_void_p}" = "x${ac_cv_sizeof_long_long}"; then
+    BFD_HOST_64BIT_LONG_LONG=1
+  fi
   test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long"
   test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long"
+elif test "x${ac_cv_sizeof_void_p}" = "x${ac_cv_sizeof_long_long}"; then
+  host64=true
+  BFD_HOST_64BIT_LONG_LONG=1
+  test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long long"
+  test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long long"
 elif test "x${ac_cv_sizeof_long_long}" = "x8"; then
   test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long long"
   test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long long"
@@ -131,6 +141,7 @@
 fi
 
 AC_SUBST(BFD_HOST_64BIT_LONG)
+AC_SUBST(BFD_HOST_64BIT_LONG_LONG)
 AC_SUBST(BFD_HOST_LONG_LONG)
 AC_SUBST(BFD_HOST_64_BIT_DEFINED)
 AC_SUBST(BFD_HOST_64_BIT)
Index: bfd-in.h
===================================================================
RCS file: /cvs/src/src/bfd/bfd-in.h,v
retrieving revision 1.126
diff -b -u -r1.126 bfd-in.h
--- bfd-in.h	20 Mar 2007 20:19:07 -0000	1.126
+++ bfd-in.h	11 Apr 2007 15:16:10 -0000
@@ -76,6 +76,7 @@
 #define BFD_DEFAULT_TARGET_SIZE @bfd_default_target_size@
 
 #define BFD_HOST_64BIT_LONG @BFD_HOST_64BIT_LONG@
+#define BFD_HOST_64BIT_LONG_LONG @BFD_HOST_64BIT_LONG_LONG@
 #define BFD_HOST_LONG_LONG @BFD_HOST_LONG_LONG@
 #if @BFD_HOST_64_BIT_DEFINED@
 #define BFD_HOST_64_BIT @BFD_HOST_64_BIT@
@@ -96,6 +97,16 @@
 #endif
 #endif
 
+/* Declaring a type wide enough to hold a host long and a host pointer.  */
+#if BFD_HOST_64BIT_LONG_LONG == 1 && BFD_HOST_64BIT_LONG == 0
+#undef BFD_HOSTPTR_T_PRINT
+typedef unsigned long long bfd_hostptr_t;
+#define BFD_HOSTPTR_T_PRT_X	"%llx"
+#else
+typedef unsigned long bfd_hostptr_t;
+#define BFD_HOSTPTR_T_PRT_X	"%lx"
+#endif
+
 /* Forward declaration.  */
 typedef struct bfd bfd;
 
@@ -129,6 +140,9 @@
 #if BFD_HOST_64BIT_LONG
 #define sprintf_vma(s,x) sprintf (s, "%016lx", x)
 #define fprintf_vma(f,x) fprintf (f, "%016lx", x)
+#elif BFD_HOST_64BIT_LONG_LONG
+#define sprintf_vma(s,x) sprintf (s, "%016llx", x)
+#define fprintf_vma(f,x) fprintf (f, "%016llx", x)
 #else
 #define _bfd_int64_low(x) ((unsigned long) (((x) & 0xffffffff)))
 #define _bfd_int64_high(x) ((unsigned long) (((x) >> 32) & 0xffffffff))
=

  reply	other threads:[~2007-04-11 15:23 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-11 13:43 Kai Tietz
2007-04-11 13:58 ` H. J. Lu
2007-04-11 14:07   ` H. J. Lu
2007-04-11 18:22     ` PATCH: windres Kai Tietz
2007-04-12 15:55       ` H. J. Lu
2007-04-12 16:51         ` Kai Tietz
2007-04-12 18:03           ` H. J. Lu
2007-04-13 14:41             ` Kai Tietz
2007-04-13 14:49               ` H. J. Lu
2007-04-16 10:05                 ` Kai Tietz
2007-04-16 21:59                   ` Christopher Faylor
2007-04-16 22:20                     ` H. J. Lu
2007-04-17 10:59                       ` Kai Tietz
2007-04-18  4:34                         ` Christopher Faylor
2007-04-18  9:49                           ` H. J. Lu
2007-04-20 13:34                             ` Kai Tietz
2007-04-20 13:35                               ` H. J. Lu
2007-04-20 13:54                                 ` Kai Tietz
2007-04-20 14:03                                   ` H. J. Lu
2007-04-20 13:40                               ` Dave Korn
2007-04-20 13:51                                 ` Kai Tietz
2007-04-20 13:58                                   ` Dave Korn
2007-04-23 12:26                                     ` Kai Tietz
2007-04-23 12:44                                       ` Christopher Faylor
2007-04-23 13:51                                         ` Kai Tietz
2007-04-23 14:23                                           ` Christopher Faylor
2007-04-23 14:36                                             ` Dave Korn
2007-04-23 14:46                                               ` Kai Tietz
2007-04-23 14:50                                                 ` Christopher Faylor
2007-04-18 11:59     ` PATCH: w64 native support Kai Tietz
2007-06-29  5:37       ` NightStrike
2007-07-12  7:30       ` Nick Clifton
2007-07-24  8:00         ` NightStrike
2007-04-11 14:57   ` Kai Tietz
2007-04-11 15:17     ` Daniel Jacobowitz
2007-04-11 15:24       ` Kai Tietz [this message]
2007-04-11 15:43         ` Daniel Jacobowitz
2007-04-11 15:49           ` Kai Tietz
2007-04-11 17:34             ` Daniel Jacobowitz
  -- strict thread matches above, loose matches on Subject: below --
2007-04-10 16:06 Kai Tietz
2007-04-10 16:13 ` H. J. Lu
2007-04-10 16:23   ` Kai Tietz
2007-04-10 17:01   ` Kai Tietz
2007-04-10 17:18     ` H. J. Lu
2007-04-10 17:52       ` Kai Tietz
2007-04-10 19:35         ` H. J. Lu
2007-04-11  3:40           ` H. J. Lu
2007-04-10 20:55       ` Paul Koning

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=OF44FF5A09.150B707F-ONC12572BA.005355F1-C12572BA.0054580A@onevision.de \
    --to=kai.tietz@onevision.com \
    --cc=binutils@sources.redhat.com \
    --cc=drow@false.org \
    --cc=hjl@lucon.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).