public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/47047] New: Support for path translation in __FILE__
@ 2010-12-23  2:12 joerg at netbsd dot org
  2010-12-23 12:16 ` [Bug preprocessor/47047] " joseph at codesourcery dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: joerg at netbsd dot org @ 2010-12-23  2:12 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47047

           Summary: Support for path translation in __FILE__
           Product: gcc
           Version: 4.1.3
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: preprocessor
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: joerg@netbsd.org


Created attachment 22841
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22841
Implement cpp -iremap

__FILE__ expands to full path names in some situation, e.g. if it is used in a
header found via -I/some/where. The resulting leak of the header location into
the file binary is undesirable in certain situations.

For NetBSD, two relevant cases are the visiblity protection in pkgsrc, which
effectively turns /usr/pkg/include/foo into /.../work/.buildlink/include/foo
and cross-compiling the system, which would leak /.../usr/include/foo instead
of /usr/include/foo or the location of the source tree.

The attached patch implements a CPP option to match the file path against a
list of prefixes and substitute the prefix on match. With this patch, most
references to the src and obj locations in NetBSD can be translated into the
canonical positions.

The patch is the version included in NetBSD against the system gcc, it can be
updated if necessary.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug preprocessor/47047] Support for path translation in __FILE__
  2010-12-23  2:12 [Bug preprocessor/47047] New: Support for path translation in __FILE__ joerg at netbsd dot org
@ 2010-12-23 12:16 ` joseph at codesourcery dot com
  2010-12-23 12:51 ` joerg at britannica dot bec.de
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: joseph at codesourcery dot com @ 2010-12-23 12:16 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47047

--- Comment #1 from joseph at codesourcery dot com <joseph at codesourcery dot com> 2010-12-23 12:16:37 UTC ---
On Thu, 23 Dec 2010, joerg at netbsd dot org wrote:

> The patch is the version included in NetBSD against the system gcc, it can be
> updated if necessary.

Who are the authors of this patch?  It's large enough that it can't be 
considered without a copyright assignment on file with the FSF (and given 
such an assignment a version against trunk would then need to be 
submitted).


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug preprocessor/47047] Support for path translation in __FILE__
  2010-12-23  2:12 [Bug preprocessor/47047] New: Support for path translation in __FILE__ joerg at netbsd dot org
  2010-12-23 12:16 ` [Bug preprocessor/47047] " joseph at codesourcery dot com
@ 2010-12-23 12:51 ` joerg at britannica dot bec.de
  2010-12-23 16:14 ` joseph at codesourcery dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: joerg at britannica dot bec.de @ 2010-12-23 12:51 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47047

--- Comment #2 from joerg at britannica dot bec.de 2010-12-23 12:51:33 UTC ---
On Thu, Dec 23, 2010 at 12:16:40PM +0000, joseph at codesourcery dot com wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47047
> 
> --- Comment #1 from joseph at codesourcery dot com <joseph at codesourcery dot com> 2010-12-23 12:16:37 UTC ---
> On Thu, 23 Dec 2010, joerg at netbsd dot org wrote:
> 
> > The patch is the version included in NetBSD against the system gcc, it can be
> > updated if necessary.
> 
> Who are the authors of this patch?  It's large enough that it can't be 
> considered without a copyright assignment on file with the FSF (and given 
> such an assignment a version against trunk would then need to be 
> submitted).

I am the author of the text. Where can I find the papers for the FSF?

Joerg


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug preprocessor/47047] Support for path translation in __FILE__
  2010-12-23  2:12 [Bug preprocessor/47047] New: Support for path translation in __FILE__ joerg at netbsd dot org
  2010-12-23 12:16 ` [Bug preprocessor/47047] " joseph at codesourcery dot com
  2010-12-23 12:51 ` joerg at britannica dot bec.de
@ 2010-12-23 16:14 ` joseph at codesourcery dot com
  2011-02-06  4:10 ` joerg at netbsd dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: joseph at codesourcery dot com @ 2010-12-23 16:14 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47047

--- Comment #3 from joseph at codesourcery dot com <joseph at codesourcery dot com> 2010-12-23 16:13:53 UTC ---
On Thu, 23 Dec 2010, joerg at britannica dot bec.de wrote:

> > On Thu, 23 Dec 2010, joerg at netbsd dot org wrote:
> > 
> > > The patch is the version included in NetBSD against the system gcc, it can be
> > > updated if necessary.
> > 
> > Who are the authors of this patch?  It's large enough that it can't be 
> > considered without a copyright assignment on file with the FSF (and given 
> > such an assignment a version against trunk would then need to be 
> > submitted).
> 
> I am the author of the text. Where can I find the papers for the FSF?

Please fill in the form at
http://gcc.gnu.org/wiki/CopyrightAssignment
and send it to fsf-records@gnu.org and they will then send you the 
appropriate assignment form.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug preprocessor/47047] Support for path translation in __FILE__
  2010-12-23  2:12 [Bug preprocessor/47047] New: Support for path translation in __FILE__ joerg at netbsd dot org
                   ` (2 preceding siblings ...)
  2010-12-23 16:14 ` joseph at codesourcery dot com
@ 2011-02-06  4:10 ` joerg at netbsd dot org
  2013-04-07 21:29 ` dank at kegel dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: joerg at netbsd dot org @ 2011-02-06  4:10 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47047

--- Comment #4 from Joerg Sonnenberger <joerg at netbsd dot org> 2011-02-06 04:10:12 UTC ---
(In reply to comment #3)
> Please fill in the form at
> http://gcc.gnu.org/wiki/CopyrightAssignment
> and send it to fsf-records@gnu.org and they will then send you the 
> appropriate assignment form.

Done and processed.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug preprocessor/47047] Support for path translation in __FILE__
  2010-12-23  2:12 [Bug preprocessor/47047] New: Support for path translation in __FILE__ joerg at netbsd dot org
                   ` (3 preceding siblings ...)
  2011-02-06  4:10 ` joerg at netbsd dot org
@ 2013-04-07 21:29 ` dank at kegel dot com
  2013-04-08  8:11 ` joerg at netbsd dot org
  2024-03-15  4:00 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: dank at kegel dot com @ 2013-04-07 21:29 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47047

dank at kegel dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dank at kegel dot com

--- Comment #5 from dank at kegel dot com 2013-04-07 21:29:20 UTC ---
What's the status of this patch?


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug preprocessor/47047] Support for path translation in __FILE__
  2010-12-23  2:12 [Bug preprocessor/47047] New: Support for path translation in __FILE__ joerg at netbsd dot org
                   ` (4 preceding siblings ...)
  2013-04-07 21:29 ` dank at kegel dot com
@ 2013-04-08  8:11 ` joerg at netbsd dot org
  2024-03-15  4:00 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: joerg at netbsd dot org @ 2013-04-08  8:11 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47047

--- Comment #6 from Joerg Sonnenberger <joerg at netbsd dot org> 2013-04-08 08:11:45 UTC ---
Nothing has changed. It likely needs updates to apply to GCC 4.8+, but the
general functionality is still desirable, IMO.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug preprocessor/47047] Support for path translation in __FILE__
  2010-12-23  2:12 [Bug preprocessor/47047] New: Support for path translation in __FILE__ joerg at netbsd dot org
                   ` (5 preceding siblings ...)
  2013-04-08  8:11 ` joerg at netbsd dot org
@ 2024-03-15  4:00 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-15  4:00 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47047

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Yes this is a dup.

*** This bug has been marked as a duplicate of bug 70268 ***

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-03-15  4:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-23  2:12 [Bug preprocessor/47047] New: Support for path translation in __FILE__ joerg at netbsd dot org
2010-12-23 12:16 ` [Bug preprocessor/47047] " joseph at codesourcery dot com
2010-12-23 12:51 ` joerg at britannica dot bec.de
2010-12-23 16:14 ` joseph at codesourcery dot com
2011-02-06  4:10 ` joerg at netbsd dot org
2013-04-07 21:29 ` dank at kegel dot com
2013-04-08  8:11 ` joerg at netbsd dot org
2024-03-15  4:00 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).