mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: Shiz <hi@shiz.me>
Cc: musl@lists.openwall.com, darkkirb@darkkirb.be
Subject: Re: [musl] [PATCH] Add support for LLVM's Control Flow Integrity (V2)
Date: Mon, 28 Dec 2020 20:26:56 -0500	[thread overview]
Message-ID: <20201229012656.GE22981@brightrain.aerifal.cx> (raw)
In-Reply-To: <F4C8EA33-9721-47A5-BEC6-5A29A7072989@shiz.me>

On Mon, Dec 28, 2020 at 06:01:45PM +0100, Shiz wrote:
> Hi,
> 
> It seems to me guarding all of those with #ifdef __clang__ is not the optimal approach.
> What if another compilers decides to pick up the spec, or an older non-CFI
> Clang is used to compile? I think it's more logical to check the no_sanitize attribute
> with a functional test (like __has_attribute), and to just apply the used attribute
> unconditionally.

Regardless none of these changes belong in source files.

Assuming it actually can be made to work to begin with, the nocfi
stuff should be done on a file-granularity basis with per-target
CFLAGS += ...

The "used" attributes are working around some other problem, either a
bug in clang (sounds most likely) or lack of semantic usedness in musl
source, and should be fixed wherever the bug is not papered over.

Rich

  reply	other threads:[~2020-12-29  1:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-27 17:53 [musl] [PATCH] Add support for LLVM's Control Flow Integrity Charlotte Delenk
2020-12-27 23:05 ` Fangrui Song
2020-12-28  0:56   ` Fangrui Song
2020-12-28  9:20     ` Charlotte Delenk
2020-12-28 13:17       ` [musl] [PATCH] Add support for LLVM's Control Flow Integrity (V2) Charlotte Delenk
2020-12-28 17:01         ` Shiz
2020-12-29  1:26           ` Rich Felker [this message]
2020-12-29 10:20           ` Charlotte Delenk
2020-12-29 11:56             ` [musl] [PATCH 1/2] Fix LTO shared library build on GCC and Clang Charlotte Delenk
2020-12-29 11:59             ` [musl] [PATCH 2/2] Add support for LLVM's Control Flow Integrity Charlotte Delenk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201229012656.GE22981@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=darkkirb@darkkirb.be \
    --cc=hi@shiz.me \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).