Discussion:
gcc wrapper silently dropping -L
Hubert Feyrer
2013-10-27 00:42:40 UTC
Permalink
My /usr/pkgsrc is a symlink, and apparently that causes problems:

cd /usr/pkgsrc/emulators/qemu fails in different ways than it fails in /realdir/pkgsrc/emulators/qemu (2nd failure is addressed in another mail, that's fixed).
The interesting part of the work/.work.log file is here: http://pastebin.com/wLPvRquY
See that the -L option between -lz and -lfdt is removed. Silently.

Two questions:
1) Why is this -L removed at all if "pwd -L" is different from "pwd -P"? Raises confusion for me...
2) If this has to be, can there be some warning in .work.log, as is for all the unknown switches, to make debugging easier?


- Hubert
David Holland
2013-10-27 18:20:15 UTC
Permalink
That's not allowed -- it would be better if it failed clearly.

The problem is that in order to make the buildlinking work right the
wrappers need to be able to recognize which paths lead to both the
pkgsrc tree and the installed pkg tree; if there are symlinks and
therefore multiple names, it misses some forms and then does the wrong
things.

Probably it could be taught to recognize both the canonical path (in
this case /usr/pkgsrc) and the realpath'd form, as it's unlikely to
encounter any others no matter how many symlinks are involved. But as
this requires changes to the wrappers, it's unlikely anyone's going to
get to it anytime soon. :-|
--
David A. Holland
***@netbsd.org
Darrin B. Jewell
2014-07-20 02:14:38 UTC
Permalink
Post by David Holland
That's not allowed -- it would be better if it failed clearly.
The problem is that in order to make the buildlinking work right the
wrappers need to be able to recognize which paths lead to both the
pkgsrc tree and the installed pkg tree; if there are symlinks and
therefore multiple names, it misses some forms and then does the wrong
things.
Does anyone have an opinion on a patch like this?
The main thing I'm nervous about is that it changes the behavior
in the case where ${PWD} is set.

Darrin

Index: bsd.prefs.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.prefs.mk,v
retrieving revision 1.347
diff -u -r1.347 bsd.prefs.mk
--- bsd.prefs.mk 6 May 2014 14:48:06 -0000 1.347
+++ bsd.prefs.mk 20 Jul 2014 01:54:45 -0000
@@ -721,9 +721,14 @@

# If WRKOBJDIR is set, use that tree to build
.if defined(WRKOBJDIR)
+. if exists(${WRKOBJDIR})
+_WRKOBJDIR!= cd ${WRKOBJDIR} && ${PWD_CMD} -P
+BUILD_DIR?= ${_WRKOBJDIR}/${PKGPATH}
+. else
BUILD_DIR?= ${WRKOBJDIR}/${PKGPATH}
+. endif
.else
-BUILD_DIR!= cd ${.CURDIR} && ${PWD_CMD}
+BUILD_DIR!= cd ${.CURDIR} && ${PWD_CMD} -P
.endif

# If OBJHOSTNAME is set, use first component of hostname in directory name.
Loading...