[LLVMdev] strange visibility error when compiling llvm-gcc-4.2

Andrew Lenharth
Wed, 06 Feb 2008 18:05:21 -0000

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)