lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <6879F938-78C9-4FE1-B5EA-C558A54A5E70@mac.com>
Date:	Thu, 28 Jun 2007 08:20:24 -0400
From:	Kyle Moffett <mrmacman_g4@....com>
To:	David Woodhouse <dwmw2@...radead.org>
Cc:	Geert Uytterhoeven <geert@...ux-m68k.org>,
	Jan Engelhardt <jengelh@...putergmbh.de>,
	Randy Dunlap <randy.dunlap@...cle.com>,
	Adrian Bunk <bunk@...sta.de>,
	LKML Kernel <linux-kernel@...r.kernel.org>, david@...g.hm,
	linux-arch@...r.kernel.org
Subject: Re: Userspace compiler support of "long long"

On Jun 28, 2007, at 07:36:14, David Woodhouse wrote:
> On Thu, 2007-06-28 at 13:34 +0200, Geert Uytterhoeven wrote:
>> We do not support building Linux with Turbo C (or MS Visual C for  
>> Win64 P64).
>
> We're talking about types which are exposed to userspace.

Yes, and all 64-bit software built using kernel headers must be built  
in LP64 mode, anything else is pure insanity.  On LP64 (IE: how the  
kernel itself is compiled on EVERY 64-bit arch):

char == 8 bits
short == 16 bits
int == 32 bits
long == 64 bits
pointer == 64 bits
long long == 64 bits

On LP32 (IE: how the kernel itself is compiled on EVERY 32-bit arch):

char == 8 bits
short == 16 bits
int == 32 bits
long == 32 bits
pointer == 32 bits
long long == 64 bits

Ergo we can simply require that if you want to use kernel headers you  
must be using the same mode as the kernel is compiled in (LP32 or LP64).

The simplest guaranteed-not-to-break way to do this on _every_  
supported platform is:
typedef   signed char  __s8;
typedef unsigned char  __s8;
typedef   signed short __s16;
typedef unsigned short __s16;
typedef   signed int   __s32;
typedef unsigned int   __s32;
# if __STDC_VERSION__ >= 19901L
typedef   signed long long __s64;
typedef unsigned long long __s64;
# elif defined(__GNUC__)
__extension__ typedef   signed long long __s64;
__extension__ typedef unsigned long long __s64;
# endif

If you have some other compiler that works under linux *AND* supports  
a 64-bit type in non-C99-mode (whether "long long" or something  
else), then they are welcome to submit patches to fix it.

Cheers,
Kyle Moffett

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ