This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Weird behavior in glibc Makefiles, or: another example why you should never build software as root user (was: r5848 - in glibc-package/branches/eglibc-2.18/debian: . rules.d)
- From: Aurélien Jarno <aurelien at aurel32 dot net>
- To: Thomas Schwinge <thomas at codesourcery dot com>
- Cc: debian-glibc at lists dot debian dot org, libc-alpha at sourceware dot org
- Date: Wed, 4 Dec 2013 16:03:02 +0100
- Subject: Re: Weird behavior in glibc Makefiles, or: another example why you should never build software as root user (was: r5848 - in glibc-package/branches/eglibc-2.18/debian: . rules.d)
- Authentication-results: sourceware.org; auth=none
- References: <E1VnERE-0003Y2-FN at moszumanska dot debian dot org> <871uv99c59 dot fsf at kepler dot schwinge dot homeip dot net> <87ob4wr7ge dot fsf at kepler dot schwinge dot homeip dot net>
Hi!
On Wed, Dec 04, 2013 at 03:56:01PM +0100, Thomas Schwinge wrote:
> Hi!
>
> Just seen this in the Debian glibc development repository:
>
> On Sun, 1 Dec 2013 21:20:24 +0000, Aurelien Jarno <aurel32@moszumanska.debian.org> wrote:
> > Author: aurel32
> > Date: 2013-12-01 21:20:24 +0000 (Sun, 01 Dec 2013)
> > New Revision: 5848
>
> > --- glibc-package/branches/eglibc-2.18/debian/rules.d/build.mk 2013-12-01 21:03:01 UTC (rev 5847)
> > +++ glibc-package/branches/eglibc-2.18/debian/rules.d/build.mk 2013-12-01 21:20:24 UTC (rev 5848)
> > @@ -57,6 +57,11 @@
> > echo "slibdir = $(call xx,slibdir)" >> $(DEB_BUILDDIR)/configparms
> > echo "rtlddir = $(call xx,rtlddir)" >> $(DEB_BUILDDIR)/configparms
> >
> > + # Define the installation directory for all calls to make. This avoid
> > + # broken glibc makefiles to spuriously trigger install rules trying to
> > + # overwrite system headers.
> > + echo "install_root = $(CURDIR)/debian/tmp-$(curpass)" >> $(DEB_BUILDDIR)/configparms
>
> Just for reference, this very much looks like the issue (as well as the
> "solution") that I've described in
> <http://news.gmane.org/find-root.php?message_id=%3C871uv99c59.fsf%40kepler.schwinge.homeip.net%3E>.
It is actually except it is on different file, and it is inspired by
your trick. I was just worried that a file is really installed and a
directory created at the same time, so instead of adding code to to
remove this directory later in debian/rules, I have chosen to use the
final directory where the files are eventually going to be installed.
Worst case the header is going to get reinstalled during the make
install phase.
> Someone ;-) should be doing something about this eventually.
I tried a few things, that seemd to work, but they had side effects. The
best workaround I have found is the following:
diff --git a/Makerules b/Makerules
index 92c2872..4fd5f76 100644
--- a/Makerules
+++ b/Makerules
@@ -328,7 +328,7 @@ endif # $(build-shared) = yes
endif # sysd-sorted-done
# Generate .dT files as we compile.
-compile-mkdep-flags = -MD -MP -MF $@.dt -MT $@
+compile-mkdep-flags = -MMD -MP -MF $@.dt -MT $@
compile-command.S = $(compile.S) $(OUTPUT_OPTION) $(compile-mkdep-flags)
compile-command.c = $(compile.c) $(OUTPUT_OPTION) $(compile-mkdep-flags)
compile-command.cc = $(compile.cc) $(OUTPUT_OPTION) $(compile-mkdep-flags)
That said if a system header is modified intentionally, the affected
files in the glibc build won't be rebuilt anymore. It should be fine for
a package, but not for upstream development.
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net