public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/26764]  New: sed command garbled when generating macro_list
@ 2006-03-20  6:57 eggert at gnu dot org
  2006-03-20  6:58 ` [Bug other/26764] " eggert at gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: eggert at gnu dot org @ 2006-03-20  6:57 UTC (permalink / raw)
  To: gcc-bugs

This problem occurs on Solaris 8 when building macro_list.
Here the output of 'make' in the neighborhood:

   echo |  ./xgcc -B./ -B/opt/reb/lib/gcc/gcc-4.1.0/sparc-sun-solaris2.8/bin/
-isystem /opt/reb/lib/gcc/gcc-4.1.0/sparc-sun-solaris2.8/include -isystem
/opt/reb/lib/gcc/gcc-4.1.0/sparc-sun-solaris2.8/sys-include
-L/export/duryea/reb/src/base/gcc/build/gcc/../ld -E -dM - | \
     sed -n 's/^#define \([^_][a-zA-Z0-9_]*\).*/\1/p ; \
           s/^#define \(_[^_A-Z][a-zA-Z0-9_]*\).*/\1/p' | \
     sort -u > tmp-macro_list
   sed: command garbled: s/^#define \([^_][a-zA-Z0-9_]*\).*/\1/p ;  s/^#define
\(_[^_A-Z][a-zA-Z0-9_]*\).*/\1/p
   /bin/ksh /reb/src/base/gcc/gcc-4.1.0/gcc/../move-if-change tmp-macro_list
macro_list
   echo timestamp > s-macro_list

The problem is the sed command.  gcc/Makefile.in relies on unportable
behavior in sed: it passes a script containing backslash-newline to
'sed'.  Some 'sed' implementations ignore the backslash-newline, but
Solaris 8 sed does not, and POSIX does not define the behavior of
backslash-newline outside commands in 'sed' scripts so GCC is relying
on unportable behavior here.

As a result of this bug, the macro_list file is empty, and the
fixincludes procedure does not fix many include files that it should.
For example, the "defined(sun)" strings in <X11/Xos.h> are not
replaced by "defined(__sun__)" as they should be.

I'll attach a patch.


-- 
           Summary: sed command garbled when generating macro_list
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: eggert at gnu dot org
 GCC build triplet: sparc-sun-solaris2.8
  GCC host triplet: sparc-sun-solaris2.8
GCC target triplet: sparc-sun-solaris2.8


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


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

* [Bug other/26764] sed command garbled when generating macro_list
  2006-03-20  6:57 [Bug other/26764] New: sed command garbled when generating macro_list eggert at gnu dot org
@ 2006-03-20  6:58 ` eggert at gnu dot org
  2006-03-20  7:12 ` [Bug bootstrap/26764] " ebotcazou at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: eggert at gnu dot org @ 2006-03-20  6:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from eggert at gnu dot org  2006-03-20 06:58 -------
Created an attachment (id=11071)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11071&action=view)
Makefile.in patch to avoid garbled sed command


-- 


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


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

* [Bug bootstrap/26764] sed command garbled when generating macro_list
  2006-03-20  6:57 [Bug other/26764] New: sed command garbled when generating macro_list eggert at gnu dot org
  2006-03-20  6:58 ` [Bug other/26764] " eggert at gnu dot org
@ 2006-03-20  7:12 ` ebotcazou at gcc dot gnu dot org
  2006-04-30  4:28 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2006-03-20  7:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from ebotcazou at gcc dot gnu dot org  2006-03-20 07:12 -------
> I'll attach a patch.

Would you mind posting it to gcc-patches@gcc.gnu.org?  I'll apply it if it is
accepted.  Thanks in advance.


-- 

ebotcazou at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebotcazou at gcc dot gnu dot
                   |                            |org


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


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

* [Bug bootstrap/26764] sed command garbled when generating macro_list
  2006-03-20  6:57 [Bug other/26764] New: sed command garbled when generating macro_list eggert at gnu dot org
  2006-03-20  6:58 ` [Bug other/26764] " eggert at gnu dot org
  2006-03-20  7:12 ` [Bug bootstrap/26764] " ebotcazou at gcc dot gnu dot org
@ 2006-04-30  4:28 ` pinskia at gcc dot gnu dot org
  2006-04-30  4:29 ` [Bug bootstrap/26764] [4.0/4.1 only] " pinskia at gcc dot gnu dot org
  2006-10-03 16:11 ` ghazi at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-04-30  4:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2006-04-30 04:28 -------
*** Bug 27334 has been marked as a duplicate of this bug. ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vapier at gentoo dot org


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


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

* [Bug bootstrap/26764] [4.0/4.1 only] sed command garbled when generating macro_list
  2006-03-20  6:57 [Bug other/26764] New: sed command garbled when generating macro_list eggert at gnu dot org
                   ` (2 preceding siblings ...)
  2006-04-30  4:28 ` pinskia at gcc dot gnu dot org
@ 2006-04-30  4:29 ` pinskia at gcc dot gnu dot org
  2006-10-03 16:11 ` ghazi at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-04-30  4:29 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
  GCC build triplet|sparc-sun-solaris2.8        |
   GCC host triplet|sparc-sun-solaris2.8        |
 GCC target triplet|sparc-sun-solaris2.8        |
   Last reconfirmed|0000-00-00 00:00:00         |2006-04-30 04:28:59
               date|                            |
            Summary|sed command garbled when    |[4.0/4.1 only] sed command
                   |generating macro_list       |garbled when generating
                   |                            |macro_list


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


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

* [Bug bootstrap/26764] [4.0/4.1 only] sed command garbled when generating macro_list
  2006-03-20  6:57 [Bug other/26764] New: sed command garbled when generating macro_list eggert at gnu dot org
                   ` (3 preceding siblings ...)
  2006-04-30  4:29 ` [Bug bootstrap/26764] [4.0/4.1 only] " pinskia at gcc dot gnu dot org
@ 2006-10-03 16:11 ` ghazi at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2006-10-03 16:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from ghazi at gcc dot gnu dot org  2006-10-03 16:10 -------
Seems to have been fixed on trunk in April and on 4.0/4.1 branches in
September.

http://gcc.gnu.org/ml/gcc-patches/2006-03/msg01260.html
http://gcc.gnu.org/ml/gcc-patches/2006-04/msg01157.html
http://gcc.gnu.org/ml/gcc-patches/2006-09/msg00186.html

I verified that e.g. sun gets replaced by __sun__ on solaris10 and solaris7.


-- 

ghazi at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
      Known to work|                            |4.0.4 4.1.2 4.2.0
         Resolution|                            |FIXED
   Target Milestone|---                         |4.0.4


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


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

end of thread, other threads:[~2006-10-03 16:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-20  6:57 [Bug other/26764] New: sed command garbled when generating macro_list eggert at gnu dot org
2006-03-20  6:58 ` [Bug other/26764] " eggert at gnu dot org
2006-03-20  7:12 ` [Bug bootstrap/26764] " ebotcazou at gcc dot gnu dot org
2006-04-30  4:28 ` pinskia at gcc dot gnu dot org
2006-04-30  4:29 ` [Bug bootstrap/26764] [4.0/4.1 only] " pinskia at gcc dot gnu dot org
2006-10-03 16:11 ` ghazi 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).