This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: glibc 2.18 rt/tst-mqueue4.c compilation error


On Mon, 2013-10-07 at 15:29 -0700, Roland McGrath wrote:
> So you went out of your way to compile libc itself with -D_FORTIFY_SOURCE=2.
> If this is the only problem you had, I'm surprised.  We explicitly do not
> support building that way.

Roland,

I have used glibc ArchLinux PKGBUILD script written by Allan McRae. To
be more accurate only programs are built with -D_FORTIFY_SOURCE=2. I
have personalized a bit the configure switches like enabling syscalls
from 3.10 and up so I have something that is slightly different than the
official release. but sometimes, I feel like a rare beast that care
about unit tests output.

Here is a small snippet of the scripts:

  # remove hardening options for building libraries
  CFLAGS=${CFLAGS/-fstack-protector/}
  CPPFLAGS=${CPPFLAGS/-D_FORTIFY_SOURCE=2/}

  ${srcdir}/${pkgname}-${pkgver}/configure --prefix=/usr \
      --libdir=/usr/lib --libexecdir=/usr/lib \
      --with-headers=/usr/include \
      --with-bugurl=https://bugs.archlinux.org/ \
      --enable-add-ons=nptl,libidn \
      --enable-obsolete-rpc \
      --enable-kernel=2.6.32 \
      --enable-bind-now --disable-profile \
      --enable-stackguard-randomization \
      --enable-lock-elision \
      --enable-multi-arch

  # build libraries with hardening disabled
  echo "build-programs=no" >> configparms
  make

  # re-enable hardening for programs
  sed -i "/build-programs=/s#no#yes#" configparms
  echo "CC += -fstack-protector -D_FORTIFY_SOURCE=2" >> configparms
  echo "CXX += -fstack-protector -D_FORTIFY_SOURCE=2" >> configparms
  make





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]