Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Aug 2014 11:33:40 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 193120] New: [bsd.xfce.mk] erroneously poisons CPPFLAGS with -L${LOCALBASE}/lib
Message-ID:  <bug-193120-13@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=193120

            Bug ID: 193120
           Summary: [bsd.xfce.mk] erroneously poisons CPPFLAGS with
                    -L${LOCALBASE}/lib
           Product: Ports Tree
           Version: Latest
          Hardware: Any
                OS: Any
            Status: Needs Triage
          Severity: Affects Many People
          Priority: Normal
         Component: Individual Port(s)
          Assignee: freebsd-ports-bugs@FreeBSD.org
          Reporter: amdmi3@FreeBSD.org

Created attachment 146483
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=146483&action=edit
bsd.xfce.mk.patch

xfce4-notification-daemon haven't built without my fix:

---
/usr/bin/ld: .libs/theme.o: relocation R_X86_64_32 against `a local symbol' can
not be used when making a shared object; recompile with -fPIC
.libs/theme.o: could not read symbols: Bad value
cc: error: linker command failed with exit code 1 (use -v to see invocation)
---

the fix (r366484):

---
Index: Makefile
===================================================================
--- Makefile    (revision 366483)
+++ Makefile    (revision 366484)
@@ -26,6 +26,7 @@
 USE_GNOME=    librsvg2
 USE_LDCONFIG=    yes
 USE_XFCE=    configenv libutil libgui
+CFLAGS+=    -fPIC

 CONFIGURE_ARGS+=    --libdir=${PREFIX}/lib/xfce4 \
             --libexecdir=${PREFIX}/libexec/xfce4 \
---

tijl@ pointed out that it's not quite correct:

---
> Can you check config.log to see if the configure test for -fPIC fails
> without this change?
> Adding -fPIC to CFLAGS is a big hammer solution for what is usually a
> small problem and it causes executables and static libraries to be
> compiled with -fPIC as well when normally only shared libraries have
> to be compiled with it.
---

after investigation, I've found out that -fPIC test in configure
really fails as configure checks for -fPIC support not by analyzing
compiler exit code by by checking if it emits a warning (as it's
expected to emit a warning and ignore -fPIC if it's not supported).
This check fails, as compiler does emit a warning:

---
configure:7357: checking for cc option to produce PIC
configure:7567: result: -fPIC
configure:7575: checking if cc PIC flag -fPIC works
configure:7593: cc -c -O2 -pipe -fno-strict-aliasing -I/usr/local/include
-L/usr/local/lib -fPIC -DPIC conftest.c >&5
cc: warning: argument unused during compilation: '-L/usr/local/lib'
configure:7597: $? = 0
configure:7610: result: no
---

this -L/usr/local/lib gets there from bsd.xfce.mk

---
configenv_CONFIGURE_ENV=        CPPFLAGS="${CPPFLAGS} -I${LOCALBASE}/include
-L${LOCALBASE}/lib"
---

Is there a reason for -L${LOCALBASE}/lib there?

It seems to me that it should be removed, and probably whole thing should be
changed to appending CPPFLAGS instead of CONFIGURE_ENV, as CONFIGURE_ENV always
contains CPPFLAGS anyway. See fix.

-- 
You are receiving this mail because:
You are the assignee for the bug.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-193120-13>