mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] problem compiling gdbserver and gdb with -Wcast-align
@ 2013-09-04 14:19 Alexander Dahl
  2013-09-04 18:38 ` Uwe Kleine-König
  2013-09-09  9:38 ` Michael Olbrich
  0 siblings, 2 replies; 4+ messages in thread
From: Alexander Dahl @ 2013-09-04 14:19 UTC (permalink / raw)
  To: PTXdist Developer Mailinglist

Hei hei, 

at the moment we are using ptxdist 2013.07.1 with OSELAS toolchain
2012.12.1 for arm-v5te. We usually have set -Wcast-align in the extra
toolchain options (TARGET_EXTRA_CFLAGS and the two for C++) to spot
alignment problems in our code. Most software packages throw alignment
warnings. Ignoring what this actually means, this is no problem as long
as the package does not set -Werror. gdb sets -Werror. We tried most
currently available versions of gdb and the build fails, e.g. like this:

/home/adahl/Work/bsp/XXX/platform-XXX/build-target/gdbserver-7.5/gdb/gdbserver/../common/agent.c:
In function 'agent_look_up_symbols':
/home/adahl/Work/bsp/XXX/platform-XXX/build-target/gdbserver-7.5/gdb/gdbserver/../common/agent.c:95:2:
error: cast increases required alignment of target type
[-Werror=cast-align]
cc1: all warnings being treated as errors
make[1]: *** [agent.o] Error 1

I guess one could dig into gdb sources, find and hopefully fix the
problem, make a patch, send it to upstream and to ptxdist, wait, do all
the usual things.

One could also drop the additional flag globally.

My question: is it possible to override the TARGET_EXTRA_CFLAGS per
package? Maybe in rules/gdbserver.make? Or would this be a bad idea?

I'd like a quick solution where I don't have to dig into gdb source code
and can keep the global target warnings. O:-)

Greets
Alex

-- 
»With the first link, the chain is forged. The first speech censured,
the first thought forbidden, the first freedom denied, chains us all
irrevocably.« (Jean-Luc Picard, quoting Judge Aaron Satie)
*** GnuPG-FP: 02C8 A590 7FE5 CA5F 3601  D1D5 8FBA 7744 CC87 10D0 ***

-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] problem compiling gdbserver and gdb with -Wcast-align
  2013-09-04 14:19 [ptxdist] problem compiling gdbserver and gdb with -Wcast-align Alexander Dahl
@ 2013-09-04 18:38 ` Uwe Kleine-König
  2013-09-05  7:19   ` Alexander Dahl
  2013-09-09  9:38 ` Michael Olbrich
  1 sibling, 1 reply; 4+ messages in thread
From: Uwe Kleine-König @ 2013-09-04 18:38 UTC (permalink / raw)
  To: ptxdist

On Wed, Sep 04, 2013 at 04:19:08PM +0200, Alexander Dahl wrote:
> Hei hei, 
> 
> at the moment we are using ptxdist 2013.07.1 with OSELAS toolchain
> 2012.12.1 for arm-v5te. We usually have set -Wcast-align in the extra
> toolchain options (TARGET_EXTRA_CFLAGS and the two for C++) to spot
> alignment problems in our code. Most software packages throw alignment
> warnings. Ignoring what this actually means, this is no problem as long
> as the package does not set -Werror. gdb sets -Werror. We tried most
> currently available versions of gdb and the build fails, e.g. like this:
> 
> /home/adahl/Work/bsp/XXX/platform-XXX/build-target/gdbserver-7.5/gdb/gdbserver/../common/agent.c:
> In function 'agent_look_up_symbols':
> /home/adahl/Work/bsp/XXX/platform-XXX/build-target/gdbserver-7.5/gdb/gdbserver/../common/agent.c:95:2:
> error: cast increases required alignment of target type
> [-Werror=cast-align]
> cc1: all warnings being treated as errors
> make[1]: *** [agent.o] Error 1
> 
> I guess one could dig into gdb sources, find and hopefully fix the
> problem, make a patch, send it to upstream and to ptxdist, wait, do all
> the usual things.
> 
> One could also drop the additional flag globally.
> 
> My question: is it possible to override the TARGET_EXTRA_CFLAGS per
> package? Maybe in rules/gdbserver.make? Or would this be a bad idea?
> 
> I'd like a quick solution where I don't have to dig into gdb source code
> and can keep the global target warnings. O:-)
Drop the flag from the global options and use it for your code is the
obvious alternative. This way you generate the warnings exactly in the
parts of the build that you seem to care about.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] problem compiling gdbserver and gdb with -Wcast-align
  2013-09-04 18:38 ` Uwe Kleine-König
@ 2013-09-05  7:19   ` Alexander Dahl
  0 siblings, 0 replies; 4+ messages in thread
From: Alexander Dahl @ 2013-09-05  7:19 UTC (permalink / raw)
  To: ptxdist

Hei hei, 

Am 2013-09-04 20:38, schrieb Uwe Kleine-König:
> Drop the flag from the global options and use it for your code is the
> obvious alternative. This way you generate the warnings exactly in the
> parts of the build that you seem to care about.

The not so obvious for you: we talk about a little more than 100
projects here. :-/

Ok, thanks anyway.
Alex

-- 
»With the first link, the chain is forged. The first speech censured,
the first thought forbidden, the first freedom denied, chains us all
irrevocably.« (Jean-Luc Picard, quoting Judge Aaron Satie)
*** GnuPG-FP: 02C8 A590 7FE5 CA5F 3601  D1D5 8FBA 7744 CC87 10D0 ***

-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] problem compiling gdbserver and gdb with -Wcast-align
  2013-09-04 14:19 [ptxdist] problem compiling gdbserver and gdb with -Wcast-align Alexander Dahl
  2013-09-04 18:38 ` Uwe Kleine-König
@ 2013-09-09  9:38 ` Michael Olbrich
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Olbrich @ 2013-09-09  9:38 UTC (permalink / raw)
  To: ptxdist

On Wed, Sep 04, 2013 at 04:19:08PM +0200, Alexander Dahl wrote:
> at the moment we are using ptxdist 2013.07.1 with OSELAS toolchain
> 2012.12.1 for arm-v5te. We usually have set -Wcast-align in the extra
> toolchain options (TARGET_EXTRA_CFLAGS and the two for C++) to spot
> alignment problems in our code. Most software packages throw alignment
> warnings. Ignoring what this actually means, this is no problem as long
> as the package does not set -Werror. gdb sets -Werror. We tried most
> currently available versions of gdb and the build fails, e.g. like this:
> 
> /home/adahl/Work/bsp/XXX/platform-XXX/build-target/gdbserver-7.5/gdb/gdbserver/../common/agent.c:
> In function 'agent_look_up_symbols':
> /home/adahl/Work/bsp/XXX/platform-XXX/build-target/gdbserver-7.5/gdb/gdbserver/../common/agent.c:95:2:
> error: cast increases required alignment of target type
> [-Werror=cast-align]
> cc1: all warnings being treated as errors
> make[1]: *** [agent.o] Error 1
> 
> I guess one could dig into gdb sources, find and hopefully fix the
> problem, make a patch, send it to upstream and to ptxdist, wait, do all
> the usual things.
> 
> One could also drop the additional flag globally.
> 
> My question: is it possible to override the TARGET_EXTRA_CFLAGS per
> package? Maybe in rules/gdbserver.make? Or would this be a bad idea?
> 
> I'd like a quick solution where I don't have to dig into gdb source code
> and can keep the global target warnings. O:-)

An interesting problem. I think what you need is a -Wno-error=cast-align or
just -Wno-error. The problem is, that right now TARGET_EXTRA_CFLAGS are
added at the beginning of the command-line, so the -Werror from gdb will
overwrite it.
Maybe we can move the TARGET_EXTRA_CFLAGS to the end. I'm not sure if there
are any compiler flags, that must be specified at the beginning like some
of the linker flags?

Also, I think an (optional?) -Wno-error at the end would make sense.

Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

end of thread, other threads:[~2013-09-09  9:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-04 14:19 [ptxdist] problem compiling gdbserver and gdb with -Wcast-align Alexander Dahl
2013-09-04 18:38 ` Uwe Kleine-König
2013-09-05  7:19   ` Alexander Dahl
2013-09-09  9:38 ` Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox