public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug pch/36277]  New: Please allow directing pch file localization/usage via direct compiler flag.
@ 2008-05-20 12:07 bursig at gmail dot com
  2008-05-20 13:27 ` [Bug pch/36277] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: bursig at gmail dot com @ 2008-05-20 12:07 UTC (permalink / raw)
  To: gcc-bugs

Currently I maintain large C/C++ project (over 400 lib/bin targets and ~100 000
files). It is targeted and ported on Sun (with Sun CC), HPUX (with aCC), Linux
(with gcc) and Windows (MSVC). The Sun, HP and Windows compilers have common
flags syntax and usage logic of pch functionality (create and use flags, etc).
The Gcc chose own way of pch usage (direct *.h compilation and auto finding on
Includes path) which force users to complicate build rules for gcc exception.

The creation part is not so problematic than usage because all issues could be
solved in build logic (as exception) but usage require bigger influence. The
usage is more problematic because typically projects are older that gcc pch
support and pch files lay directly in project/targets dirs (plus may have same
names in different projects: stdafx.h ;)) which force us to create pch.gch
direct in sources (gcc first search *.c/*.cpp dir for includes and pch). This
limitation (may) give us many other problems like read-only src's tree, src's
tree on dynamic medias, ugly project's which share files :| , playing with
pch.gch dir and his contents, etc.

Good solution would be -fpch-use=path/file.gch flag which allow us create pch
together with obj's files and simple tell gcc where it could be find.


-- 
           Summary: Please allow directing pch file localization/usage via
                    direct compiler flag.
           Product: gcc
           Version: 3.4.6
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: pch
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bursig at gmail dot com


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


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

* [Bug pch/36277] Please allow directing pch file localization/usage via direct compiler flag.
  2008-05-20 12:07 [Bug pch/36277] New: Please allow directing pch file localization/usage via direct compiler flag bursig at gmail dot com
@ 2008-05-20 13:27 ` pinskia at gcc dot gnu dot org
  2008-05-20 15:42 ` bursig at gmail dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-05-20 13:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2008-05-20 13:26 -------
I really don't see the issue here really, if you don't setup your include
pathes correctly to include the object directory first, that seems like your
issue rather than a limitation of GCC.


-- 


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


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

* [Bug pch/36277] Please allow directing pch file localization/usage via direct compiler flag.
  2008-05-20 12:07 [Bug pch/36277] New: Please allow directing pch file localization/usage via direct compiler flag bursig at gmail dot com
  2008-05-20 13:27 ` [Bug pch/36277] " pinskia at gcc dot gnu dot org
@ 2008-05-20 15:42 ` bursig at gmail dot com
  2008-05-20 15:44 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: bursig at gmail dot com @ 2008-05-20 15:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from bursig at gmail dot com  2008-05-20 15:42 -------
(In reply to comment #1)
> I really don't see the issue here really, if you don't setup your include
> pathes correctly to include the object directory first, that seems like your
> issue rather than a limitation of GCC.
> 
Then please create simple pch.h (with stdlib.h included) and main.c (where you
include pch.h) in same dir. Now create obj dir in pwd and build pch.h.gch (gcc
-H -O2 -Iobj pch.h -c -o obj/pch.h.gch) there. Now build main.c as gcc -O2 -H
-Iobj -c -o main.o main.c. As I know gcc search headers in *.c/*.cpp dir before
touch -I search paths.

In my case pch is not used... As I say may before projects already exist and
changing source tree (moving pch headers outoff sources dir) for gcc is not
good news for me because it will automatically disable pch with Sun CC (Sun
require pch.h in source dir).


-- 


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


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

* [Bug pch/36277] Please allow directing pch file localization/usage via direct compiler flag.
  2008-05-20 12:07 [Bug pch/36277] New: Please allow directing pch file localization/usage via direct compiler flag bursig at gmail dot com
  2008-05-20 13:27 ` [Bug pch/36277] " pinskia at gcc dot gnu dot org
  2008-05-20 15:42 ` bursig at gmail dot com
@ 2008-05-20 15:44 ` pinskia at gcc dot gnu dot org
  2008-05-20 16:16 ` bursig at gmail dot com
  2008-08-11  2:03 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-05-20 15:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2008-05-20 15:44 -------
>As I know gcc search headers in *.c/*.cpp dir before
touch -I search paths.

Only for "" include directories and you can disable that with at one point with
-I- so ...


-- 


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


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

* [Bug pch/36277] Please allow directing pch file localization/usage via direct compiler flag.
  2008-05-20 12:07 [Bug pch/36277] New: Please allow directing pch file localization/usage via direct compiler flag bursig at gmail dot com
                   ` (2 preceding siblings ...)
  2008-05-20 15:44 ` pinskia at gcc dot gnu dot org
@ 2008-05-20 16:16 ` bursig at gmail dot com
  2008-08-11  2:03 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: bursig at gmail dot com @ 2008-05-20 16:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from bursig at gmail dot com  2008-05-20 16:16 -------
(In reply to comment #3)
> >As I know gcc search headers in *.c/*.cpp dir before
> touch -I search paths.
> 
> Only for "" include directories and you can disable that with at one point with
> -I- so ...
> 
hmm...
1) any pch.h is project specific file then should use "" and not <>.
2) -I- is deprecated and I don't know when it disappear.
3) Using it force me to review all project and secure all -I sequences and
track of all not exit source dir on -I paths.


-- 


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


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

* [Bug pch/36277] Please allow directing pch file localization/usage via direct compiler flag.
  2008-05-20 12:07 [Bug pch/36277] New: Please allow directing pch file localization/usage via direct compiler flag bursig at gmail dot com
                   ` (3 preceding siblings ...)
  2008-05-20 16:16 ` bursig at gmail dot com
@ 2008-08-11  2:03 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-08-11  2:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pinskia at gcc dot gnu dot org  2008-08-11 02:02 -------
Use -iquote for "" paths.


-- 


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


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

end of thread, other threads:[~2008-08-11  2:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-20 12:07 [Bug pch/36277] New: Please allow directing pch file localization/usage via direct compiler flag bursig at gmail dot com
2008-05-20 13:27 ` [Bug pch/36277] " pinskia at gcc dot gnu dot org
2008-05-20 15:42 ` bursig at gmail dot com
2008-05-20 15:44 ` pinskia at gcc dot gnu dot org
2008-05-20 16:16 ` bursig at gmail dot com
2008-08-11  2:03 ` pinskia at gcc dot gnu dot 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).