mailing list of musl libc
 help / color / mirror / code / Atom feed
* Re: [PATCH v2] First prototype of script which adds CFI directives to x86 asm
@ 2015-05-13 17:36 Alex Dowad
  2015-05-14  2:32 ` Rich Felker
  0 siblings, 1 reply; 2+ messages in thread
From: Alex Dowad @ 2015-05-13 17:36 UTC (permalink / raw)
  To: musl

Thanks to Szabolcs Nagy for your reply!

> it might make sense to have a make rule that produces the cfi asm for inspection

Any opinions from others on this?

> i wonder if a configure check for .cfi support should be added: in theory
> an assembler may not support it (tcc?)

Sure, I can do this. If debugging is not enabled, it doesn't make much sense
to use the CFI script either.

Would adding another variable to config.mak, something like GENERATE_CFI=yes
(or something like that) be acceptable?

> move this loop to BEGIN so it only runs at startup

I tried benchmarking and there is no measurable impact on performance either way.
I would prefer to leave the loop where it is, to make the script easier to read
(keeping related code together).

I added 'i' to the argument list to make it local -- thanks for the tip.

> i think hex conversion for $123 is wrong in i386 asm

Fixed in the v2.

> allow whitespace between ',' and the regs

Fixed, thanks.

> (missing .cfi_startproc/endproc might be problematic i think
> because .cfi directives can be rejected outside of startproc/endproc)

Yes, that's why the script doesn't emit them unless it is inside a startproc/endproc pair.

Regarding the concern with .type @function, I am trying a different strategy now
for identifying the beginning and end of functions. Please see the v3 (soon to be
posted).

Thanks,
Alex


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

* Re: Re: [PATCH v2] First prototype of script which adds CFI directives to x86 asm
  2015-05-13 17:36 [PATCH v2] First prototype of script which adds CFI directives to x86 asm Alex Dowad
@ 2015-05-14  2:32 ` Rich Felker
  0 siblings, 0 replies; 2+ messages in thread
From: Rich Felker @ 2015-05-14  2:32 UTC (permalink / raw)
  To: musl

On Wed, May 13, 2015 at 07:36:46PM +0200, Alex Dowad wrote:
> Thanks to Szabolcs Nagy for your reply!
> 
> > it might make sense to have a make rule that produces the cfi asm for inspection
> 
> Any opinions from others on this?

I'm not sure. It's more clutter. It could be useful for debugging
issues, but so could intermediate .s files from the compiler before
making .o files, and in that case you just have to make them manually
if you want.

> > i wonder if a configure check for .cfi support should be added: in theory
> > an assembler may not support it (tcc?)
> 
> Sure, I can do this. If debugging is not enabled, it doesn't make much sense
> to use the CFI script either.
> 
> Would adding another variable to config.mak, something like GENERATE_CFI=yes
> (or something like that) be acceptable?

Perhaps configure should generate an AS_CMD variable or something,
making it just plain $CC for non-debug builds or when the CFI stuff
isn't supported, and something that wraps the call to $CC when CFI is
supported and desired (debug).

Rich


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

end of thread, other threads:[~2015-05-14  2:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-13 17:36 [PATCH v2] First prototype of script which adds CFI directives to x86 asm Alex Dowad
2015-05-14  2:32 ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).