Opened 9 years ago

Closed 9 years ago

#32087 closed defect (fixed)

cairo: error: implicit declaration of function "__builtin___stpncpy_chk"

Reported by: ongrie@… Owned by: ryandesign (Ryan Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.0.3
Keywords: lion haspatch Cc: jerkejacobs@…, raimue (Rainer Müller), jxzhu@…, robin@…, sarma72@…
Port: cairo

Description

I'm not getting cairo compiled under Lion, it seems to have some problems with the system includes. I attached the log...

Does anybody have any suggestions?

Attachments (2)

main.log (87.2 KB) - added by ongrie@… 9 years ago.
llvm-main.log (420.3 KB) - added by ongrie@… 9 years ago.

Download all attachments as: .zip

Change History (20)

comment:1 in reply to:  description Changed 9 years ago by ongrie@…

Replying to ongrie@…:

I'm not getting cairo compiled under Lion, it seems to have some problems with the system includes. I attached the log...

Does anybody have any suggestions?

I also tried with:

$ sudo port install cairo build.jobs=1 configure.compiler=gcc-4.2

as mentioned in #30405 but got the same error…

comment:2 Changed 9 years ago by ongrie@…

Cc: ongrie@… added

Cc Me!

comment:3 in reply to:  2 Changed 9 years ago by ongrie@…

Replying to ongrie@…:

Cc Me!

OK now I completely messed up this track. I wanted to set the Cc but accidentally added myself. Also there is no edit button so I replied to it. I hope some admins will fix it.

Sorry though!

comment:4 Changed 9 years ago by ryandesign (Ryan Schmidt)

Cc: ongrie@… removed
Keywords: cairo removed
Owner: changed from macports-tickets@… to ryandesign@…
Summary: cairo fails to build on Lioncairo: error: implicit declaration of function "__builtin___stpncpy_chk"

The log you attached isn't complete... can you clean and try again please?

sudo port clean cairo
sudo port install cairo

If that still fails, please attach the new main.log.

Changed 9 years ago by ongrie@…

Attachment: main.log added

comment:5 in reply to:  4 Changed 9 years ago by ongrie@…

Replying to ryandesign@…:

The log you attached isn't complete... can you clean and try again please?

sudo port clean cairo
sudo port install cairo

If that still fails, please attach the new main.log.

Yea it failed, I attached the full log.

comment:6 Changed 9 years ago by ryandesign (Ryan Schmidt)

It looks like you're running OS X 10.7.2, right? What version of Xcode do you have?

comment:7 in reply to:  6 Changed 9 years ago by ongrie@…

Replying to ryandesign@…:

It looks like you're running OS X 10.7.2, right? What version of Xcode do you have?

You're right, I'm using 10.7.2 and the latest Xcode 4.2.

$ uname -a
Darwin greybox.local 11.2.0 Darwin Kernel Version 11.2.0: Tue Aug  9 20:54:00 PDT 2011; root:xnu-1699.24.8~1/RELEASE_X86_64 x86_64

comment:8 Changed 9 years ago by ryandesign (Ryan Schmidt)

If you have Xcode 4.2, then I'm confused why /usr/bin/gcc-4.2 exists; Xcode 4.2 doesn't include gcc anymore.

comment:9 in reply to:  8 Changed 9 years ago by ongrie@…

Replying to ryandesign@…:

If you have Xcode 4.2, then I'm confused why /usr/bin/gcc-4.2 exists; Xcode 4.2 doesn't include gcc anymore.

I need the GNU GCC for some other projects, that's why it's installed. Below my "compiler collection" ;-)

anonymous@anonymous.local:/
$ ls -al /usr/bin/gcc*
lrwxr-xr-x  1 root  wheel      12 Nov 15 22:21 /usr/bin/gcc -> llvm-gcc-4.2
-rwxr-xr-x  1 root  wheel   97392 May 18  2009 /usr/bin/gcc-4.0
-rwxr-xr-x  1 root  wheel  166128 May 18  2009 /usr/bin/gcc-4.2
anonymous@anonymous.local:/
$ ls -al /usr/bin/llvm-*
lrwxr-xr-x  1 root  admin  32 Nov 15 22:20 /usr/bin/llvm-cpp-4.2 -> ../llvm-gcc-4.2/bin/llvm-cpp-4.2
lrwxr-xr-x  1 root  admin  32 Nov 15 22:20 /usr/bin/llvm-g++ -> ../llvm-gcc-4.2/bin/llvm-g++-4.2
lrwxr-xr-x  1 root  admin  32 Nov 15 22:20 /usr/bin/llvm-g++-4.2 -> ../llvm-gcc-4.2/bin/llvm-g++-4.2
lrwxr-xr-x  1 root  admin  32 Nov 15 22:20 /usr/bin/llvm-gcc -> ../llvm-gcc-4.2/bin/llvm-gcc-4.2
lrwxr-xr-x  1 root  admin  32 Nov 15 22:20 /usr/bin/llvm-gcc-4.2 -> ../llvm-gcc-4.2/bin/llvm-gcc-4.2

Changed 9 years ago by ongrie@…

Attachment: llvm-main.log added

comment:10 in reply to:  description Changed 9 years ago by ongrie@…

I set the compiler to LLVM GCC:

sudo port install cairo configure.compiler=llvm-gcc-4.2

and executed clean, then tried to compile it again, but no luck. Although I've got another error message, I still don't know what to do. I attached the new log (llvm-main.log) and post the relevant line below.

:info:build Undefined symbols for architecture x86_64:
:info:build   "_cairo_boilerplate_get_target_by_name", referenced from:
:info:build       _main in cairo_sphinx-sphinx.o
:info:build ld: symbol(s) not found for architecture x86_64
:info:build clang: error: linker command failed with exit code 1 (use -v to see invocation)
:info:build make[4]: *** [cairo-sphinx] Error 1

comment:11 Changed 9 years ago by ryandesign (Ryan Schmidt)

We already know that cairo will not work correctly when compiled with clang or llvm-gcc-4.2, which is why the port forces the use of gcc-4.2. However, on Xcode 4.2, there isn't supposed to be a gcc-4.2, so the port is supposed to use the apple-gcc42 port in that case. But since you've somehow restored gcc-4.2 onto your system, the port is using it.

Try installing the apple-gcc42 port and using it compile cairo:

sudo port install apple-gcc42
sudo port clean cairo
sudo port install cairo configure.compiler=apple-gcc-4.2 configure.cxx=g++-apple-4.2

See ProblemHotlist#xcode42.

Several other ports use the same programming to force the use of gcc-4.2; these might also fail because of your rogue gcc-4.2/gcc-4.0 compilers, so I recommend you remove them. If you need the Apple versions of gcc while using Xcode 4.2, consider using the compilers installed by the apple-gcc42/apple-gcc40 ports. These should be slightly newer versions that should work on Lion.

comment:12 in reply to:  11 ; Changed 9 years ago by ongrie@…

Replying to ryandesign@…:

Several other ports use the same programming to force the use of gcc-4.2; these might also fail because of your rogue gcc-4.2/gcc-4.0 compilers, so I recommend you remove them. If you need the Apple versions of gcc while using Xcode 4.2, consider using the compilers installed by the apple-gcc42/apple-gcc40 ports. These should be slightly newer versions that should work on Lion.

OK thanks! I'm now building apple-gcc42 and try it again. One more question, how should I remove my "rough gcc4.2" compiles safely?

comment:13 in reply to:  12 ; Changed 9 years ago by ryandesign (Ryan Schmidt)

Replying to ongrie@…:

how should I remove my "rough gcc4.2" compiles safely?

I'm not sure... how did you install them?

comment:14 in reply to:  13 Changed 9 years ago by ongrie@…

Replying to ryandesign@…:

Replying to ongrie@…:

how should I remove my "rough gcc4.2" compiles safely?

I'm not sure... how did you install them?

I installed Xcode 3.2 and then Xcode 4.2 ;-) I'll figure it out anyhow…

Thanks for your help regarding cairo, now it built fine!

comment:15 Changed 9 years ago by ryandesign (Ryan Schmidt)

Cc: jerkejacobs@… raimue@… jxzhu@… added
Keywords: haspatch added
Status: newassigned

Has duplicates #32811 (has a patch for disabling lto so that cairo can be compiled with llvm-gcc-4.2 to avoid the problem) and #32848.

comment:16 Changed 9 years ago by robin@…

Cc: robin@… added

Cc Me!

comment:17 Changed 9 years ago by ryandesign (Ryan Schmidt)

Cc: sarma72@… added

Has duplicate #33009.

comment:18 Changed 9 years ago by ryandesign (Ryan Schmidt)

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.