On Mon, Sep 15, 2014 at 08:52:27PM +0400, Ilya Verbin wrote: > This patch contains necessary changes for the build system to support > offloading. > It adds 2 new options for configure: > * --enable-as-accelerator-for=ARG is intended for the offload target compiler. > * --enable-offload-targets=LIST is intended for the offload host compiler. > Some more info: > https://gcc.gnu.org/wiki/Offloading#Building_host_and_accel_compilers > > Bootstrapped and regtested on i686-linux and x86_64-linux. Is it OK for > trunk?
Looks mostly ok, just some nits. But see the patch I've just posted, perhaps we want to tweak the --enable-offload-targets arguments. And I'd strongly prefer if the offloading patches are committed after everything has been reviewed, so what will be acked please stash away for later batch commits. > --- /dev/null > +++ b/libgcc/ompstuff.c > @@ -0,0 +1,79 @@ > +/* FIXME: Including auto-host is incorrect, but until we have > + identified the set of defines that need to go into auto-target.h, > + this will have to do. */ > +#include "auto-host.h" > +#undef pid_t > +#undef rlim_t > +#undef ssize_t > +#undef vfork crtstuff.c undefs here also caddr_t, any reason not to do that too? > +#include "tconfig.h" > +#include "tsystem.h" > +#include "coretypes.h" > +#include "tm.h" > +#include "libgcc_tm.h" > + > +#define OFFLOAD_FUNC_TABLE_SECTION_NAME "__gnu_offload_funcs" > +#define OFFLOAD_VAR_TABLE_SECTION_NAME "__gnu_offload_vars" > + > +#ifdef CRT_BEGIN > + > +#if defined(HAVE_GAS_HIDDEN) && defined(ENABLE_OFFLOADING) > +void *_omp_func_table[0] > + __attribute__ ((__used__, visibility ("hidden"), > + section (OFFLOAD_FUNC_TABLE_SECTION_NAME))) = { }; > +void *_omp_var_table[0] > + __attribute__ ((__used__, visibility ("hidden"), > + section (OFFLOAD_VAR_TABLE_SECTION_NAME))) = { }; > +#endif Does this mean that if HAVE_GAS_HIDDEN is not defined, you don't define _omp_*_table at all and offloading will fail? I wonder if it just should avoid visibility ("hidden") if it isn't supported. Jakub