public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] "Bad" and "good" GCC FLAGS for ECOS environment
@ 2008-11-14 16:51 Sergei Gavrikov
  2008-11-14 17:23 ` Jonathan Larmour
  0 siblings, 1 reply; 5+ messages in thread
From: Sergei Gavrikov @ 2008-11-14 16:51 UTC (permalink / raw)
  To: eCos discuss list

[-- Attachment #1: Type: text/plain, Size: 4967 bytes --]

Hello,

Trying new arm-eabi-gcc to build existen targets I noticed what it is
not possible to build some of them. Issue is it's CYGBLD_GLOBAL_CFLAGS.
Greeping, viming the hal*.cdl(s) I found no up-to-dated CFLAGS for GCC4
which I can use as the good example, at the least, it seemed for me.

I am not GCC expert and I know the very minimal CFLAGS set: -O{0,2}; -g;
-Wall :-) I ask experts, What FLAG is good for new GCC in eCos and what
FLAG is "bad"? I know only one "bad" for GCC-4: -mno-short-load-words,
but, a few targets still use it. I've known one good flag from Jonathan
Larmour: -Wno-write-strings. Can anyone distribute his knowledges about
other GCC-4 flags for _eCos_ environment? 

I wrote a simple Tcl script to build CFLAGS histograms (see the below)
just for expetrs who can "underline" the table's rows by a comment in
1-2 lines or even just mark the rows by asterisks. There are a head
(list of inspected targets) and 2 columns table: the 1st column contains
a meet GCC flag, the 2nd -- target's names (or aliases) which use this
flag on the screen Long lists are truncated.  If anybody interests in
the script I attach it. You can get same tables for powerpc, i386, etc.

Commentators, welcome use: egrep -v -- '-(mcpu|O2|g|Wall|endian)' for
your comments. I think all know about these GCC options even I know it.

All Experts, thank you for your knowledges!

All the best,

	Sergei

RFC

cma230|ebsa285|gps4020|aim711|aeb|snds|pid|integrator|e7t|edb7xxx

              -mthumb : cma230 aim711 pid
       -mcpu=arm7tdmi : cma230 gps4020 aim711 pid integrator e7t edb7xxx
    -mthumb-interwork : cma230 aim711 pid
                -Wall : cma230 ebsa285 gps4020 aim711 aeb pid integrator
      -Wpointer-arith : cma230 ebsa285 gps4020 aim711 aeb pid integrator
  -Wstrict-prototypes : cma230 ebsa285 gps4020 aim711 aeb pid integrator
             -Winline : cma230 ebsa285 gps4020 aim711 aeb pid integrator
              -Wundef : cma230 ebsa285 gps4020 aim711 aeb pid integrator
 -Woverloaded-virtual : cma230 ebsa285 gps4020 aim711 aeb pid integrator
                   -g : cma230 ebsa285 gps4020 aim711 aeb pid integrator
                  -O2 : cma230 ebsa285 gps4020 aim711 aeb pid integrator
  -ffunction-sections : cma230 ebsa285 gps4020 aim711 aeb pid integrator
      -fdata-sections : cma230 ebsa285 gps4020 aim711 aeb pid integrator
            -fno-rtti : cma230 ebsa285 gps4020 aim711 aeb pid integrator
      -fno-exceptions : cma230 ebsa285 gps4020 aim711 aeb pid integrator
          -fvtable-gc : cma230 ebsa285 gps4020 aim711 aeb pid integrator
      -finit-priority : cma230 ebsa285 gps4020 aim711 aeb pid integrator
      -mcpu=strongarm : ebsa285
         -mbig-endian : aim711 pid
-mno-short-load-words : aim711 e7t
         -mcpu=arm7di : aeb
           -mcpu=arm9 : pid integrator
  -fno-schedule-insns : integrator
        -mcpu=arm710c : edb7xxx

10 targe(s) processed

p2106|phycore229x|mcb2100|lpcmt|ea2468|nano|ipaq|cerfpda|brutus|assabet|
sa1100mm|flexanet|cerf|innovator|smdk2410|excalibur|aaed2000|uE250|mpc50
|xsengine|picasso|iop310|ixdp425|prpmc1100|iq80321|grg|eb55|eb42|at91sam

              -mthumb : p2106 phycore229x mcb2100 lpcmt ea2468 eb55 eb42
    -mthumb-interwork : p2106 phycore229x mcb2100 lpcmt ea2468 eb55 eb42
       -mcpu=arm7tdmi : p2106 phycore229x mcb2100 lpcmt ea2468 eb55 eb42
-mno-short-load-words : p2106 phycore229x mcb2100 lpcmt ea2468 eb55 eb42
                -Wall : p2106 phycore229x mcb2100 lpcmt ea2468 nano ipaq
      -Wpointer-arith : p2106 phycore229x mcb2100 lpcmt ea2468 nano ipaq
  -Wstrict-prototypes : p2106 phycore229x mcb2100 lpcmt ea2468 nano ipaq
             -Winline : p2106 phycore229x mcb2100 lpcmt ea2468 nano ipaq
              -Wundef : p2106 phycore229x mcb2100 lpcmt ea2468 nano ipaq
 -Woverloaded-virtual : p2106 phycore229x mcb2100 lpcmt ea2468 nano ipaq
                   -g : p2106 phycore229x mcb2100 lpcmt ea2468 nano ipaq
                  -O2 : p2106 phycore229x mcb2100 lpcmt ea2468 nano ipaq
  -ffunction-sections : p2106 phycore229x mcb2100 lpcmt ea2468 nano ipaq
      -fdata-sections : p2106 phycore229x mcb2100 lpcmt ea2468 nano ipaq
            -fno-rtti : p2106 phycore229x mcb2100 lpcmt ea2468 nano ipaq
      -fno-exceptions : p2106 phycore229x mcb2100 lpcmt ea2468 nano ipaq
          -fvtable-gc : p2106 phycore229x mcb2100 lpcmt ea2468 nano ipaq
      -finit-priority : p2106 phycore229x mcb2100 lpcmt ea2468 nano ipaq
  -mcpu=strongarm1100 : nano ipaq cerfpda brutus assabet sa1100mm flexanet
         -mapcs-frame : sa1100mm uE250 mpc50 xsengine picasso iop310 ixdp425
           -mcpu=arm9 : innovator smdk2410 excalibur aaed2000
         -fno-builtin : uE250 xsengine picasso
         -mcpu=xscale : mpc50 iop310 ixdp425 prpmc1100 iq80321 grg
         -mbig-endian : ixdp425 prpmc1100 grg mace1 mac7100evb
            -gdwarf-2 : mace1 mac7100evb

35 targe(s) processed

Note: the tables were got as "cflagseek hal/arm/*/*/*/*{,/*}"

[-- Attachment #2: cflagseek --]
[-- Type: text/plain, Size: 2728 bytes --]

#!/usr/bin/env tclsh

set program [file tail [info script]]

if {!$argc} {
    puts "Usage: $program pattern ?pattern ...?"
    puts "  pattern is: a glob like relative path to inspected CDL file(s)"
    puts ""
    puts "Example: $program hal/powerpc/*/*/*/*" 
    return 1
}

if {![info exists env(ECOS_REPOSITORY)]} {
    puts "The environment variable ECOS_REPOSITORY is not set"
    return 1
}

set top $env(ECOS_REPOSITORY)

proc reset_stats {} {
    foreach li {aliases found stats} {set ::$li [list]}
}

proc extract_flags {tcled_cflags alias} {
    global aliases found stats

    lappend aliases $alias; lappend stats $alias
    set flags {}
    foreach f [regexp -inline -all -expanded -- {(?:-[^ \"]+)} $tcled_cflags] {
	lappend flags $f
	if {[lsearch -exact $found $f] < 0} {
	    lappend found $f
	}
    }
    lappend stats $flags
}

proc print_stats {{cut 72}} {
    global aliases found stats

    if {[llength $stats] == 0} {return}

    # header | fmt -w 72
    set header [join $aliases "|"]
    if {[string length $header] >= $cut} {
	foreach row [regexp -all -inline [string repeat . $cut] $header] {
	    puts $row
	}
    } else {
	puts $header
    }
    puts {}

    # what is the longest flag?
    set width 0
    foreach flag $found {
	set len [string length $flag]
	if {$len > $width} {
	    set width $len
	}
    }

    # print a histogram: flag : target ?target ...?
    # Note: long lines will be truncated, look at 'cut' parameter.
    foreach flag $found {
	set line ""; set column 0;
	append line [format "%${width}s :" $flag]
	incr column 
	foreach {alias flags} $stats {
	    if {[lsearch -exact $flags $flag] >= 0} {
		if {[string length $line] >= $cut} {
		    #append line " ..."
		    break
		} else {
		    append line " $alias"
		}
	    }
	}
	puts $line
    }

    puts [format "\n%d targe(s) processed\n" [llength $aliases]]
}

# unknow -- 'eats' all unknow tokens, but processes one: cdl_option
# 	     CYGBLD_GLOBAL_CFLAGS
proc unknown args {
    foreach {cdl_type name body} $args {
	switch -glob -- $cdl_type {
	    cdl_* {
		if {$name eq {CYGBLD_GLOBAL_CFLAGS}} {
		    # get CFLAGS value
		    set where [expr {[lsearch -regexp $body {^default}] + 1}]
		    set tcled_cflags [lindex $body $where]
		    regexp -- {^.*_(.*?)\.cdl$} [info script] -> alias

		    extract_flags $tcled_cflags $alias

		    return ;# return from sourced CDL
		}
		eval $body ;# eval {...}
	    }
	    default {
		break
	    }
	}
    }
}

# MAIN
foreach arg $argv {
    reset_stats
    foreach cdl [glob -nocomplain -- [file join $top $arg]] {
	if {[file isfile $cdl] && [file extension $cdl] eq ".cdl"} {source $cdl}
    }
    print_stats
}

# vim: set filetype=tcl smarttab smartindent shiftwidth=4:


[-- Attachment #3: Type: text/plain, Size: 148 bytes --]

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] "Bad" and "good" GCC FLAGS for ECOS environment
  2008-11-14 16:51 [ECOS] "Bad" and "good" GCC FLAGS for ECOS environment Sergei Gavrikov
@ 2008-11-14 17:23 ` Jonathan Larmour
  2008-11-14 18:11   ` [ECOS] " Grant Edwards
  2008-11-14 19:22   ` [ECOS] " Sergei Gavrikov
  0 siblings, 2 replies; 5+ messages in thread
From: Jonathan Larmour @ 2008-11-14 17:23 UTC (permalink / raw)
  To: Sergei Gavrikov; +Cc: eCos discuss list

Sergei Gavrikov wrote:
> Hello,
> 
> Trying new arm-eabi-gcc to build existen targets I noticed what it is
> not possible to build some of them. Issue is it's CYGBLD_GLOBAL_CFLAGS.
> Greeping, viming the hal*.cdl(s) I found no up-to-dated CFLAGS for GCC4
> which I can use as the good example, at the least, it seemed for me.
> 
> I am not GCC expert and I know the very minimal CFLAGS set: -O{0,2}; -g;
> -Wall :-) I ask experts, What FLAG is good for new GCC in eCos and what
> FLAG is "bad"? I know only one "bad" for GCC-4: -mno-short-load-words,
> but, a few targets still use it. I've known one good flag from Jonathan
> Larmour: -Wno-write-strings. Can anyone distribute his knowledges about
> other GCC-4 flags for _eCos_ environment? 

-mno-short-load-words, -fvtable-gc, and -finit-priority will be removed
everywhere at the same time as I centralise warning flags.

I'm loathe to change any other flags without being able to test on the
specific targets in question.

I will mention though that the aeb isn't supported with the new tools as it
is arm7di. After this amount of time there really didn't seem worth the
large amount of space having a multilib for it. Everything has multipliers
now. There's also no separate strongarm multilib any more. I believe this
just makes things suboptimal, rather than stopping things working. At
worst, there's the existing tools.

Jifl
-- 
eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["Si fractum non sit, noli id reficere"]------       Opinions==mine

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* [ECOS]  Re: "Bad" and "good" GCC FLAGS for ECOS environment
  2008-11-14 17:23 ` Jonathan Larmour
@ 2008-11-14 18:11   ` Grant Edwards
  2008-11-14 18:15     ` Jonathan Larmour
  2008-11-14 19:22   ` [ECOS] " Sergei Gavrikov
  1 sibling, 1 reply; 5+ messages in thread
From: Grant Edwards @ 2008-11-14 18:11 UTC (permalink / raw)
  To: ecos-discuss

On 2008-11-14, Jonathan Larmour <jifl@eCosCentric.com> wrote:

> I will mention though that the aeb isn't supported with the
> new tools as it is arm7di.

I'm unclear on what that means.  Are ARM7 targets are no longer
supported?

-- 
Grant Edwards                   grante             Yow! MERYL STREEP is my
                                  at               obstetrician!
                               visi.com            


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS]  Re: "Bad" and "good" GCC FLAGS for ECOS environment
  2008-11-14 18:11   ` [ECOS] " Grant Edwards
@ 2008-11-14 18:15     ` Jonathan Larmour
  0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Larmour @ 2008-11-14 18:15 UTC (permalink / raw)
  To: Grant Edwards; +Cc: eCos discussion

Grant Edwards wrote:
> On 2008-11-14, Jonathan Larmour <jifl@eCosCentric.com> wrote:
> 
>> I will mention though that the aeb isn't supported with the
>> new tools as it is arm7di.
> 
> I'm unclear on what that means.  Are ARM7 targets are no longer
> supported?

Modern ARM7 targets are supported and in fact arm7tdmi is the default
target cpu. The arm7di though has no hardware 32x32 multiplier (the 'm').
We wouldn't want to drop multiplier support for arm7tdmi if we made a
lowest-common-denominator multilib (there's lots of math stuff in libgcc
for example, especially soft FP). But for such an ancient core, it's not
worth the effort and disk space of a separate multilib. There's always the
existing 3.2.1 tools.

Jifl
-- 
eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["Si fractum non sit, noli id reficere"]------       Opinions==mine

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] "Bad" and "good" GCC FLAGS for ECOS environment
  2008-11-14 17:23 ` Jonathan Larmour
  2008-11-14 18:11   ` [ECOS] " Grant Edwards
@ 2008-11-14 19:22   ` Sergei Gavrikov
  1 sibling, 0 replies; 5+ messages in thread
From: Sergei Gavrikov @ 2008-11-14 19:22 UTC (permalink / raw)
  To: Jonathan Larmour; +Cc: eCos discuss list

Jonathan Larmour wrote:
> -mno-short-load-words, -fvtable-gc, and -finit-priority will be removed
> everywhere at the same time as I centralise warning flags.
> 
> I'm loathe to change any other flags without being able to test on the
> specific targets in question.
> 
> I will mention though that the aeb isn't supported with the new tools as it
> is arm7di. After this amount of time there really didn't seem worth the
> large amount of space having a multilib for it. Everything has multipliers
> now. There's also no separate strongarm multilib any more. I believe this
> just makes things suboptimal, rather than stopping things working. At
> worst, there's the existing tools.

Jonathan, thank you very much for your enlightening comments and now I
know even more than I asked about. I will patient wait for an ajusting
GCC warning flags.

Thank you,
Sergei

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

end of thread, other threads:[~2008-11-14 18:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-14 16:51 [ECOS] "Bad" and "good" GCC FLAGS for ECOS environment Sergei Gavrikov
2008-11-14 17:23 ` Jonathan Larmour
2008-11-14 18:11   ` [ECOS] " Grant Edwards
2008-11-14 18:15     ` Jonathan Larmour
2008-11-14 19:22   ` [ECOS] " Sergei Gavrikov

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).