This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch i386]: Disable builtins exec(l/v) for x86_64-pc-mingw* target
- From: "Danny Smith" <dansmister at gmail dot com>
- To: "Kai Tietz" <Kai dot Tietz at onevision dot com>
- Cc: "GCC Patches" <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 25 Apr 2008 09:27:58 +1200
- Subject: Re: [patch i386]: Disable builtins exec(l/v) for x86_64-pc-mingw* target
- References: <OF5A315F0A.8668B767-ONC1257435.0048E09D-C1257435.0049D130@onevision.de>
Kai, rersending as forgot to CC GCC patches in first reply.
0n Fri, Apr 25, 2008 at 1:26 AM, Kai Tietz wrote:
> Hello,
>
> This patch disables the default execl/execv builtin definitions for the
> x86_64-pc-mingw32 target . For this target the return type is intptr_t,
> which is different as defined by builtin.def.
>
> 2004-04-24 Kai Tietz <kai.tietz@onevision.com>
>
> * config/i386/i386.c (ix86_init_builtins): Use of MINGW_BUILTINS
> macro
> * config/i386/mingw-c.c: New.
> * config/i386/mingw32.h (MINGW_BUILTINS): New macro,
> (x86_setup_msbuiltins): New prototype.
> * config/i386/t-cygming: Add build rule for mingw-c.c.
> * config.gcc: Add new file mingw-c.o to target objects for mingw.
>
Why not something that doesn't need the c_target_objs, eg (not tested
on 64 bit target)
In mingw32.h:
#undef SUBTARGET_INIT_BUILTINS
#define SUBTARGET_INIT_BUILTINS \
do { \
if (TARGET_64BIT_MS_ABI) \
{ \
/* These builtin functions have a different return \
type (intptr_t) on 64-bit MS Windows. */ \
disable_builtin_function ("execl"); \
disable_builtin_function ("execlp"); \
disable_builtin_function ("execle"); \
disable_builtin_function ("execv"); \
disable_builtin_function ("execvp"); \
disable_builtin_function ("execve"); \
} \
/* Second argument of MS scalb is long, not double. */ \
disable_builtin_function ("scalb"); \
} while (0) \
And in i386.c ix86_init_builtins(), add
#ifdef SUBTARGET_INIT_BUILTINS
SUBTARGET_INIT_BUILTINS;
#endif
Danny