This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch i386]: Disable builtins exec(l/v) for x86_64-pc-mingw* target


On Fri, Apr 25, 2008 at 9:49 AM, Kai Tietz <ktietz70@googlemail.com> wrote:
> 2008/4/24 Danny Smith <dansmister@gmail.com>:
>
>
> > 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
>  >
>
>  Ok, this is fine for me, too. I will sent an update for this. My
>  question is here, if we shouldn't add an '#undef
>  SUBTARGET_INIT_BUILTINS' in i386.h, too. So we indicate to other i386
>  targets, that this customization define exists?

That is a question for i386 maintainer.  Probably best to CC  Uros
when submiiting revised patch.
Danny


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]