lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 13 Apr 2017 17:37:45 -0700
From:   Matthias Kaehlcke <mka@...omium.org>
To:     Masahiro Yamada <yamada.masahiro@...ionext.com>
Cc:     Michal Marek <mmarek@...e.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
        Grant Grundler <grundler@...omium.org>,
        Michael Davidson <md@...gle.com>,
        Greg Hackmann <ghackmann@...gle.com>,
        Behan Webster <behanw@...verseincode.com>,
        Peter Foley <pefoley2@...oley.com>
Subject: Re: [RFC PATCH] kbuild: Fix asm-offset generation to work with clang

El Tue, Apr 11, 2017 at 11:03:54AM -0700 Matthias Kaehlcke ha dit:

> El Tue, Apr 11, 2017 at 09:01:41PM +0900 Masahiro Yamada ha dit:
> 
> > 2017-04-04 6:25 GMT+09:00 Matthias Kaehlcke <mka@...omium.org>:
> > > When using clang with -no-integerated-as clang will use the gnu
> > > assembler instead of the integrated assembler. However clang will
> > > still perform asm error checking before sending the inline assembly
> > > language to gas.
> > >
> > > The generation of asm-offsets from within C code is dependent on gcc's
> > > blind passing of whatever is in asm() through to gas. Arbirary text is
> > > passed through which is then modified by a sed script into the
> > > appropriate .h and .S code. Since the arbitrary text is not valid
> > > assembly language, clang fails.
> > >
> > > This can be fixed by making the arbitrary text into an ASM comment and
> > > then updating the sed scripts accordingly to work as expected.
> > >
> > > This solution works for both gcc and clang.
> > >
> > > Based-on-patch-from: Behan Webster <behanw@...verseincode.com>
> > > Signed-off-by: Matthias Kaehlcke <mka@...omium.org>
> > 
> > 
> > 
> > Could you check Jeroen Hofstee's work for U-Boot?
> > 
> > http://patchwork.ozlabs.org/patch/375026/
> 
> No I didn't come across it, thanks for the pointer!
> 
> > His idea is to use .ascii string
> > in order to handle this in arch-agnostic way.
> 
> Looks good, way cleaner than my proposed solution :)
> 
> > If you are happy about this idea,
> > I can forward his patch (with a little bit adjustment).
> 
> With forward you mean you plan to port it? Otherwise I'm also happy to
> give it a go, just let me know.
> 
> > We may want to refactor the patch because
> > the double mark ".ascii" and "->" seem redundant,
> > but it is just a detail.
> 
> Agree, since we are already touching this part we might as well remove
> the "->".

Thinking about it a bit more it seems safer to keep the "->" since
the input file might contain actual ".ascii" directives.

Cheers

Matthias

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ