Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Jan 2017 18:18:18 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-toolchain@FreeBSD.org
Subject:   [Bug 216587] cc should accept -pie argument
Message-ID:  <bug-216587-29464-kZCI9W6rgE@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-216587-29464@https.bugs.freebsd.org/bugzilla/>
References:  <bug-216587-29464@https.bugs.freebsd.org/bugzilla/>

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

Dimitry Andric <dim@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |Not A Bug
             Status|In Progress                 |Closed

--- Comment #3 from Dimitry Andric <dim@FreeBSD.org> ---
Removing some stuff from the command line to clarify:

> c++ -c [...] -pie -fPIE [...] -o chatline.o src/chatlog/chatline.cpp

So this is a compilation of a .cpp file to .o, and this case the -pie option
does not apply, as it is meant for the link phase.

Examples of how to avoid "unused argument" warnings:

$ c++ -fPIE -pie helloworld.cpp -o helloworld

$ file helloworld
helloworld: ELF 32-bit LSB shared object, Intel 80386, version 1 (FreeBSD),
dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 12.0
(1200020), FreeBSD-style, not stripped

$ c++ -fPIE -c helloworld.cpp

$ c++ -pie helloworld.o -o helloworld

$ file helloworld
helloworld: ELF 32-bit LSB shared object, Intel 80386, version 1 (FreeBSD),
dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 12.0
(1200020), FreeBSD-style, not stripped

Alternatively, if it is difficult to get upstream software to untangle CFLA=
GS,
CXXFLAGS and LDFLAGS, add -Qunused-arguments.

--=20
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-216587-29464-kZCI9W6rgE>