Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Le Bihan <eric.le.bihan.dev@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] uClibc fails to build with stack smash protection
Date: Mon, 16 Sep 2013 16:25:02 +0200	[thread overview]
Message-ID: <20130916142501.GA13623@pc-eric> (raw)

Hi!

I can not build uclibc 0.9.33.2 when stack smashing protection is activated and
GCC 4.7.x is selected. The build fails as follow:

--8<--
[...]
  STRIP -x -R .note -R .comment libc/libc_so.a
  LD libuClibc-0.9.33.2.so
libc/libc_so.a(fnmatch.os):(.text+0xe0): undefined reference to `__stack_chk_guard'
collect2: error: ld returned 1 exit status
-->8--

If GCC 4.6.x is selected, everything is fine.
Commit 2babed4a50fcd050abc4686e05e24d0e374d10a8 introduces the following change
in package/uclibc/uclibc.mk:

--8<--
-# Before uClibc is built, we must have the second stage cross-compiler
-uclibc-build: host-gcc-intermediate
+# Before uClibc is built, we must have the second stage
+# cross-compiler, for some gcc versions, and when NPTL is used.
+uclibc-build: $(if $(BR2_TOOLCHAIN_NEEDS_THREE_STAGE_BUILD),host-gcc-intermediate)
-->8--

So, with GCC 4.6.x BR2_TOOLCHAIN_NEEDS_THREE_STAGE_BUILD is set to 'y' and the
dependency to host-gcc-intermediate is added, but not with GCC 4.7.x. Forcing
the dependency (as it was before) fixes the issue.

I attached my defconfig. Did anyone else experienced this problem?
-------------- next part --------------
BR2_x86_pentiumpro=y
BR2_ENABLE_SSP=y
BR2_KERNEL_HEADERS_VERSION=y
BR2_DEFAULT_KERNEL_VERSION="3.10.7"
BR2_TOOLCHAIN_BUILDROOT_LARGEFILE=y
BR2_TOOLCHAIN_BUILDROOT_INET_IPV6=y
BR2_TOOLCHAIN_BUILDROOT_INET_RPC=y
BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
BR2_TOOLCHAIN_BUILDROOT_USE_SSP=y
BR2_TARGET_GENERIC_GETTY_PORT="tty1"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="3.10.7"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/x86/linux-3.10.config"
BR2_TARGET_ROOTFS_EXT2=y
# BR2_TARGET_ROOTFS_TAR is not set

             reply	other threads:[~2013-09-16 14:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-16 14:25 Eric Le Bihan [this message]
2013-09-18 20:22 ` [Buildroot] uClibc fails to build with stack smash protection Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130916142501.GA13623@pc-eric \
    --to=eric.le.bihan.dev@free.fr \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox