* include facility for .md files
@ 2001-11-08 13:28 Aldy Hernandez
2001-11-08 14:12 ` Alan Matsuoka
0 siblings, 1 reply; 8+ messages in thread
From: Aldy Hernandez @ 2001-11-08 13:28 UTC (permalink / raw)
To: alanm; +Cc: gcc
hi alan.
the md include system seems to only work for absolute path names. i
added (include "altivec.md") to my rs6000.md but running gen* on it
gives me:
altivec.md:13366: include file at altivec.md not found
first, the error message is wrong, it should be:
rs6000.md:13366: blah
^^^^^^^^^
it can't open altivec.md because, at least for rs6000, the gen* programs
get fed an absolute path, ie:
./genattrtab /source/net/gcc/gcc/config/rs6000/rs6000.md > tmp-attrtab.c
init_md_reader() does not initialize base_dir when an absolute filename
is given. consequently, process_include() does not have a relative
path, and tries to open altivec.md in the build directory.
to reproduce, just add a simple (include "foobar") to rs6000.md and try
to make gcc on powerpc-elf.
could you fix this?
thanks
--
Aldy Hernandez E-mail: aldyh@redhat.com
Professional Gypsy
Red Hat, Inc.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: include facility for .md files
2001-11-08 13:28 include facility for .md files Aldy Hernandez
@ 2001-11-08 14:12 ` Alan Matsuoka
2001-11-09 2:05 ` Alan Matsuoka
0 siblings, 1 reply; 8+ messages in thread
From: Alan Matsuoka @ 2001-11-08 14:12 UTC (permalink / raw)
To: Aldy Hernandez; +Cc: gcc
On Mon, 19 Nov 2001, Aldy Hernandez wrote:
> hi alan.
>
> the md include system seems to only work for absolute path names. i
> added (include "altivec.md") to my rs6000.md but running gen* on it
> gives me:
>
> altivec.md:13366: include file at altivec.md not found
>
> first, the error message is wrong, it should be:
>
> rs6000.md:13366: blah
> ^^^^^^^^^
>
> it can't open altivec.md because, at least for rs6000, the gen* programs
> get fed an absolute path, ie:
>
> ./genattrtab /source/net/gcc/gcc/config/rs6000/rs6000.md > tmp-attrtab.c
>
> init_md_reader() does not initialize base_dir when an absolute filename
> is given. consequently, process_include() does not have a relative
> path, and tries to open altivec.md in the build directory.
>
> to reproduce, just add a simple (include "foobar") to rs6000.md and try
> to make gcc on powerpc-elf.
>
> could you fix this?
>
Wierd.. I just tried on my laptop and it works fine. Tried on the G4 and it
dies as advertised. I'm looking at it.
Alan Matsuoka
GCC Engineering
Red Hat Canada, Ltd
mailto:alanm@redhat.com Tel: (416) 482-2661 x250 / Fax: (416) 482-6299
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: include facility for .md files
2001-11-08 14:12 ` Alan Matsuoka
@ 2001-11-09 2:05 ` Alan Matsuoka
2001-11-09 2:43 ` Aldy Hernandez
2001-11-09 6:40 ` Richard Henderson
0 siblings, 2 replies; 8+ messages in thread
From: Alan Matsuoka @ 2001-11-09 2:05 UTC (permalink / raw)
To: Aldy Hernandez; +Cc: gcc
On Mon, 19 Nov 2001, Alan Matsuoka wrote:
> On Mon, 19 Nov 2001, Aldy Hernandez wrote:
>
> > hi alan.
> >
> > the md include system seems to only work for absolute path names. i
> > added (include "altivec.md") to my rs6000.md but running gen* on it
> > gives me:
> >
> > altivec.md:13366: include file at altivec.md not found
> >
> > first, the error message is wrong, it should be:
> >
> > rs6000.md:13366: blah
> > ^^^^^^^^^
> >
> > it can't open altivec.md because, at least for rs6000, the gen* programs
> > get fed an absolute path, ie:
> >
> > ./genattrtab /source/net/gcc/gcc/config/rs6000/rs6000.md > tmp-attrtab.c
> >
> > init_md_reader() does not initialize base_dir when an absolute filename
> > is given. consequently, process_include() does not have a relative
> > path, and tries to open altivec.md in the build directory.
> >
> > to reproduce, just add a simple (include "foobar") to rs6000.md and try
> > to make gcc on powerpc-elf.
> >
> > could you fix this?
> >
> Wierd.. I just tried on my laptop and it works fine. Tried on the G4 and it
> dies as advertised. I'm looking at it.
>
Btw.. Why do you want to use absolute pathnames anyway ? Aren't hardcoded pathnames
taboo ?
Alan Matsuoka
GCC Engineering
Red Hat Canada, Ltd
mailto:alanm@redhat.com Tel: (416) 482-2661 x250 / Fax: (416) 482-6299
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: include facility for .md files
2001-11-09 2:05 ` Alan Matsuoka
@ 2001-11-09 2:43 ` Aldy Hernandez
2001-11-09 6:40 ` Richard Henderson
1 sibling, 0 replies; 8+ messages in thread
From: Aldy Hernandez @ 2001-11-09 2:43 UTC (permalink / raw)
To: Alan Matsuoka; +Cc: gcc
>
> Btw.. Why do you want to use absolute pathnames anyway ? Aren't hardcoded pathnames
> taboo ?
the opposite. i DONT want to have to specify absolute pathnames. right
now, when i do (include "bar.md"), it doesn't look in config/foo/bar.md.
>
> Alan Matsuoka
> GCC Engineering
> Red Hat Canada, Ltd
> mailto:alanm@redhat.com Tel: (416) 482-2661 x250 / Fax: (416) 482-6299
--
Aldy Hernandez E-mail: aldyh@redhat.com
Professional Gypsy
Red Hat, Inc.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: include facility for .md files
2001-11-09 2:05 ` Alan Matsuoka
2001-11-09 2:43 ` Aldy Hernandez
@ 2001-11-09 6:40 ` Richard Henderson
2001-11-09 6:54 ` Alan Matsuoka
2001-11-09 9:06 ` Aldy Hernandez
1 sibling, 2 replies; 8+ messages in thread
From: Richard Henderson @ 2001-11-09 6:40 UTC (permalink / raw)
To: Alan Matsuoka; +Cc: Aldy Hernandez, gcc
On Mon, Nov 19, 2001 at 06:03:33PM -0500, Alan Matsuoka wrote:
> Btw.. Why do you want to use absolute pathnames anyway?
You'd get that if you configure with
/absolute/path/src/configure
rather than
../../src/configure
r~
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: include facility for .md files
2001-11-09 6:40 ` Richard Henderson
@ 2001-11-09 6:54 ` Alan Matsuoka
2001-11-09 9:06 ` Aldy Hernandez
1 sibling, 0 replies; 8+ messages in thread
From: Alan Matsuoka @ 2001-11-09 6:54 UTC (permalink / raw)
To: Richard Henderson, Aldy Hernandez, gcc
On Mon, 19 Nov 2001, Richard Henderson wrote:
> On Mon, Nov 19, 2001 at 06:03:33PM -0500, Alan Matsuoka wrote:
> > Btw.. Why do you want to use absolute pathnames anyway?
>
> You'd get that if you configure with
>
> /absolute/path/src/configure
>
> rather than
>
> ../../src/configure
>
>
Ahh.. Got it.
Alan Matsuoka
GCC Engineering
Red Hat Canada, Ltd
mailto:alanm@redhat.com Tel: (416) 482-2661 x250 / Fax: (416) 482-6299
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: include facility for .md files
2001-11-09 6:40 ` Richard Henderson
2001-11-09 6:54 ` Alan Matsuoka
@ 2001-11-09 9:06 ` Aldy Hernandez
2001-11-09 9:27 ` Alan Matsuoka
1 sibling, 1 reply; 8+ messages in thread
From: Aldy Hernandez @ 2001-11-09 9:06 UTC (permalink / raw)
To: Richard Henderson; +Cc: Alan Matsuoka, gcc
On Mon, 2001-11-19 at 20:20, Richard Henderson wrote:
> On Mon, Nov 19, 2001 at 06:03:33PM -0500, Alan Matsuoka wrote:
> > Btw.. Why do you want to use absolute pathnames anyway?
>
> You'd get that if you configure with
>
> /absolute/path/src/configure
>
and that is exactly how i configure :)
so alan, you probably want to take the relative path from the absolute
and have additional .md includeable files be relative to the original
path.
boy that sounds confusing, but you get the pic.
> rather than
>
> ../../src/configure
>
>
> r~
--
Aldy Hernandez E-mail: aldyh@redhat.com
Professional Gypsy
Red Hat, Inc.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: include facility for .md files
2001-11-09 9:06 ` Aldy Hernandez
@ 2001-11-09 9:27 ` Alan Matsuoka
0 siblings, 0 replies; 8+ messages in thread
From: Alan Matsuoka @ 2001-11-09 9:27 UTC (permalink / raw)
To: Aldy Hernandez; +Cc: Richard Henderson, gcc
On Mon, 19 Nov 2001, Aldy Hernandez wrote:
> On Mon, 2001-11-19 at 20:20, Richard Henderson wrote:
> > On Mon, Nov 19, 2001 at 06:03:33PM -0500, Alan Matsuoka wrote:
> > > Btw.. Why do you want to use absolute pathnames anyway?
> >
> > You'd get that if you configure with
> >
> > /absolute/path/src/configure
> >
>
> and that is exactly how i configure :)
>
> so alan, you probably want to take the relative path from the absolute
> and have additional .md includeable files be relative to the original
> path.
>
> boy that sounds confusing, but you get the pic.
>
>
>
> > rather than
> >
> > ../../src/configure
> >
De left connected to de right side.. de right side connected to de other side...
de other side connected to .. dis side...
I think I know what you mean. I tried this to get things going but I'll
come up with a better solution tomorrow.
Index: gensupport.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/gensupport.c,v
retrieving revision 1.14
diff -c -p -3 -r1.14 gensupport.c
*** gensupport.c 2001/11/16 23:00:16 1.14
--- gensupport.c 2001/11/20 03:10:37
*************** init_md_reader (filename)
*** 1015,1026 ****
int c;
char *lastsl;
! if (!IS_ABSOLUTE_PATHNAME (filename))
! {
! lastsl = strrchr (filename, '/');
! if (lastsl != NULL)
! base_dir = save_string (filename, lastsl - filename + 1 );
! }
read_rtx_filename = filename;
input_file = fopen (filename, "r");
--- 1015,1023 ----
int c;
char *lastsl;
! lastsl = strrchr (filename, '/');
! if (lastsl != NULL)
! base_dir = save_string (filename, lastsl - filename + 1 );
read_rtx_filename = filename;
input_file = fopen (filename, "r");
Alan Matsuoka
GCC Engineering
Red Hat Canada, Ltd
mailto:alanm@redhat.com Tel: (416) 482-2661 x250 / Fax: (416) 482-6299
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2001-11-20 3:15 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-08 13:28 include facility for .md files Aldy Hernandez
2001-11-08 14:12 ` Alan Matsuoka
2001-11-09 2:05 ` Alan Matsuoka
2001-11-09 2:43 ` Aldy Hernandez
2001-11-09 6:40 ` Richard Henderson
2001-11-09 6:54 ` Alan Matsuoka
2001-11-09 9:06 ` Aldy Hernandez
2001-11-09 9:27 ` Alan Matsuoka
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).