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]
Message-ID: <CAK7LNASfCFW4KZ72rYXQTpYFGf+KJcjK+L8wvHtiHmXNVYRtwg@mail.gmail.com>
Date:   Fri, 21 Apr 2017 14:02:46 +0900
From:   Masahiro Yamada <yamada.masahiro@...ionext.com>
To:     Matthias Kaehlcke <mka@...omium.org>
Cc:     Michal Marek <mmarek@...e.com>, Emese Revfy <re.emese@...il.com>,
        Kees Cook <keescook@...omium.org>,
        Behan Webster <behanw@...verseincode.com>,
        "Luis R . Rodriguez" <mcgrof@...nel.org>,
        Vinícius Tinti <viniciustinti@...il.com>,
        Kyeongmin Cho <korea.drzix@...il.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>,
        Peter Foley <pefoley2@...oley.com>
Subject: Re: [PATCH v3] kbuild: Add support to generate LLVM bitcode files

Hi Matthias,


2017-04-05 2:27 GMT+09:00 Matthias Kaehlcke <mka@...omium.org>:
> From: Vinícius Tinti <viniciustinti@...il.com>
>
> Add rules to kbuild in order to generate LLVM bitcode files with the .ll
> extension when using clang.


First, I'd like to be sure about the terminology "LLVM bitcode"
because "bitcode" sounds like human-unreadable binary.


For example, 'man llvm-as' says:
    llvm-as  is  the  LLVM  assembler.  It reads a file containing
    human-readable LLVM assembly language, translates it to LLVM
    bitcode, and writes the result into a file or to standard output.


As far as I understood:

*.ll   -  LLVM assembly  (human readable file)
*.bc   -  LLVM bitcode   (binary file)

Is this correct?






>   # from c code
>   CC=clang make kernel/pid.ll

This does not work because CC is overridden in the top-level Makefile.
It should be
    make CC=clang kernel/pid.ll




>   # from asm code
>   CC=clang make arch/x86/kernel/preempt.ll

arch/x86/kernel/preempt.* does not exist
(at least in the latest tree).




> +
> +quiet_cmd_as_ll_S = CPP $(quiet_modtag) $@
> +      cmd_as_ll_S = $(CPP) $(a_flags)   -o $@ $<
> +
> +$(obj)/%.ll: $(src)/%.S FORCE
> +       $(call if_changed_dep,as_ll_S)
> +

I could not understand how this rule can convert
architecture-specific assembly to LLVM intermediate expression.

This is just pre-processing *.S file.


Actually, this is completely the same as the rule *.S -> *.s

quiet_cmd_cpp_s_S = CPP $(quiet_modtag) $@
cmd_cpp_s_S       = $(CPP) $(a_flags) -o $@ $<

$(obj)/%.s: $(src)/%.S FORCE
      $(call if_changed_dep,cpp_s_S)





-- 
Best Regards
Masahiro Yamada

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ