Chris Lattner
2008-Feb-06 17:20 UTC
[LLVMdev] strange visibility error when compiling llvm-gcc-4.2
On Feb 6, 2008, at 5:18 AM, Duncan Sands wrote:> Hi, > >> if /bin/sh ./libtool --mode=compile /s/llvm/obj.gcc42/./gcc/xgcc -B/ >> s/llvm/obj.gcc42/./gcc/ -B/usr/local/i686-pc-linux-gnu/bin/ -B/usr/ >> local/i686-pc-linux-gnu/lib/ -isystem /usr/local/i686-pc-linux-gnu/ >> include -isystem /usr/local/i686-pc-linux-gnu/sys-include - >> DHAVE_CONFIG_H -I. -I/s/llvm/svn.gcc42/libgomp -I. -I/s/llvm/ >> svn.gcc42/libgomp/config/linux/x86 -I/s/llvm/svn.gcc42/libgomp/ >> config/linux -I/s/llvm/svn.gcc42/libgomp/config/posix -I/s/llvm/ >> svn.gcc42/libgomp -Wall -Werror -ftls-model=initial-exec - >> march=i486 -mtune=i686 -Wc,-pthread -O2 -g -O2 -MT lock.lo -MD -MP >> -MF ".deps/lock.Tpo" -c -o lock.lo /s/llvm/svn.gcc42/libgomp/config/ >> linux/lock.c; \ >> then mv -f ".deps/lock.Tpo" ".deps/lock.Plo"; else rm -f >> ".deps/lock.Tpo"; exit 1; fi >> yes >> cc1: warnings being treated as errors >> /s/llvm/svn.gcc42/libgomp/team.c:341: warning: visibility attribute >> not supported in this configuration; ignored >> /s/llvm/svn.gcc42/libgomp/team.c:341: warning: visibility attribute >> not supported in this configuration; ignored >> checking for tanl... make[5]: *** [team.lo] Error 1 >> ---------------------------------- >> >> Because of the -Werror, this warning is taken as an error >> and compilation aborts. I wonder why it warns in the first >> place, is something broken with xgcc? > > I suspect this is due to the recent change by Bill (revision 46747).Bill's change only affected darwin IIRC. I don't know that anyone has built GOMP on linux yet, and OpenMP hasn't been widely tested at all. I'd suggest using --enable-languages=c,c++ -Chris
Andrew Lenharth
2008-Feb-06 17:26 UTC
[LLVMdev] strange visibility error when compiling llvm-gcc-4.2
On 2/6/08, Chris Lattner <sabre at nondot.org> wrote:> > On Feb 6, 2008, at 5:18 AM, Duncan Sands wrote: > > > Hi, > > > >> if /bin/sh ./libtool --mode=compile /s/llvm/obj.gcc42/./gcc/xgcc -B/ > >> s/llvm/obj.gcc42/./gcc/ -B/usr/local/i686-pc-linux-gnu/bin/ -B/usr/ > >> local/i686-pc-linux-gnu/lib/ -isystem /usr/local/i686-pc-linux-gnu/ > >> include -isystem /usr/local/i686-pc-linux-gnu/sys-include - > >> DHAVE_CONFIG_H -I. -I/s/llvm/svn.gcc42/libgomp -I. -I/s/llvm/ > >> svn.gcc42/libgomp/config/linux/x86 -I/s/llvm/svn.gcc42/libgomp/ > >> config/linux -I/s/llvm/svn.gcc42/libgomp/config/posix -I/s/llvm/ > >> svn.gcc42/libgomp -Wall -Werror -ftls-model=initial-exec - > >> march=i486 -mtune=i686 -Wc,-pthread -O2 -g -O2 -MT lock.lo -MD -MP > >> -MF ".deps/lock.Tpo" -c -o lock.lo /s/llvm/svn.gcc42/libgomp/config/ > >> linux/lock.c; \ > >> then mv -f ".deps/lock.Tpo" ".deps/lock.Plo"; else rm -f > >> ".deps/lock.Tpo"; exit 1; fi > >> yes > >> cc1: warnings being treated as errors > >> /s/llvm/svn.gcc42/libgomp/team.c:341: warning: visibility attribute > >> not supported in this configuration; ignored > >> /s/llvm/svn.gcc42/libgomp/team.c:341: warning: visibility attribute > >> not supported in this configuration; ignored > >> checking for tanl... make[5]: *** [team.lo] Error 1 > >> ---------------------------------- > >> > >> Because of the -Werror, this warning is taken as an error > >> and compilation aborts. I wonder why it warns in the first > >> place, is something broken with xgcc? > > > > I suspect this is due to the recent change by Bill (revision 46747). > > Bill's change only affected darwin IIRC. I don't know that anyone has > built GOMP on linux yet, and OpenMP hasn't been widely tested at all. > I'd suggest using --enable-languages=c,c++I am seeing the same errors with just building c,c++. (linux x86, also debian) Andrew
Eric Christopher
2008-Feb-06 17:41 UTC
[LLVMdev] strange visibility error when compiling llvm-gcc-4.2
>> >> I suspect this is due to the recent change by Bill (revision 46747). > > Bill's change only affected darwin IIRC. I don't know that anyone has > built GOMP on linux yet, and OpenMP hasn't been widely tested at all. > I'd suggest using --enable-languages=c,c++This looks like something is broken on the gcc side of things. Does a simple: void __attribute__((visibility ("hidden"))) foo() { } compile with your resultant compiler? -eric
Chris Lattner
2008-Feb-06 17:44 UTC
[LLVMdev] strange visibility error when compiling llvm-gcc-4.2
>>> I suspect this is due to the recent change by Bill (revision 46747). >> >> Bill's change only affected darwin IIRC. I don't know that anyone >> has >> built GOMP on linux yet, and OpenMP hasn't been widely tested at all. >> I'd suggest using --enable-languages=c,c++ > > I am seeing the same errors with just building c,c++. (linux x86, > also debian)Ah, I didn't notice that Bill changed varasm.c. Bill? -Chris
Duncan Sands
2008-Feb-06 17:54 UTC
[LLVMdev] strange visibility error when compiling llvm-gcc-4.2
> > > I suspect this is due to the recent change by Bill (revision 46747). > > > > Bill's change only affected darwin IIRC. I don't know that anyone has > > built GOMP on linux yet, and OpenMP hasn't been widely tested at all. > > I'd suggest using --enable-languages=c,c++ > > I am seeing the same errors with just building c,c++. (linux x86, also debian)There was a change to varasm.c that was not conditioned on being on darwin: + /* The "make_assemble_visibility" method may issue a warning if the visibility + attribute isn't supported in a configuration. This is all done through a + call-back. We want to issue this same warning when needed. */ + if (TREE_PUBLIC (decl)) + maybe_assemble_visibility (decl); It seems suspicious. Ciao, Duncan.
Andrew Lenharth
2008-Feb-06 18:05 UTC
[LLVMdev] strange visibility error when compiling llvm-gcc-4.2
On 2/6/08, Eric Christopher <echristo at apple.com> wrote:> >> > >> I suspect this is due to the recent change by Bill (revision 46747). > > > > Bill's change only affected darwin IIRC. I don't know that anyone has > > built GOMP on linux yet, and OpenMP hasn't been widely tested at all. > > I'd suggest using --enable-languages=c,c++ > > This looks like something is broken on the gcc side of things. Does a > simple: > > void > __attribute__((visibility ("hidden"))) > foo() > { } > > compile with your resultant compiler?; ModuleID = 'foo.c' target datalayout "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32" target triple = "i686-pc-linux-gnu" define hidden void @foo() { entry: br label %return return: ; preds = %entry ret void } also works when going to native .o or bytecode. llvm-gcc -v Using built-in specs. Target: i686-pc-linux-gnu Configured with: ../source/configure --prefix=/home/andrewl/Research/cfe-4.2/install --enable-llvm=/home/andrewl/Research/llvm --enable-languages=c,c++ --disable-bootstrap --disable-shared --disable-werror Thread model: posix gcc version 4.2.1 (Based on Apple Inc. build 5546) (LLVM build)
Duncan Sands
2008-Feb-06 18:50 UTC
[LLVMdev] strange visibility error when compiling llvm-gcc-4.2
> > Bill's change only affected darwin IIRC. I don't know that anyone has > > built GOMP on linux yet, and OpenMP hasn't been widely tested at all. > > I'd suggest using --enable-languages=c,c++ > > I am seeing the same errors with just building c,c++. (linux x86, also debian)This bit of Bill's patch did it: -#ifdef HAVE_GAS_HIDDEN + +#if !defined(ENABLE_LLVM) && defined(HAVE_GAS_HIDDEN) fprintf (asm_out_file, "\t.%s\t", type); assemble_name (asm_out_file, name); fprintf (asm_out_file, "\n"); #else warning (OPT_Wattributes, "visibility attribute not supported " "in this configuration; ignored"); #endif
Seemingly Similar Threads
- [LLVMdev] strange visibility error when compiling llvm-gcc-4.2
- [LLVMdev] strange visibility error when compiling llvm-gcc-4.2
- [LLVMdev] strange visibility error when compiling llvm-gcc-4.2
- [LLVMdev] strange visibility error when compiling llvm-gcc-4.2
- [LLVMdev] strange visibility error when compiling llvm-gcc-4.2