This is probably something you have already considered but just to play devil’s advocate, could your needs be met by putting a script called “clang” in your users’ $PATH that simply does the following?
#!/usr/bin/env bash /path/to/real/clang -march=broadwell "$@" > On Sep 25, 2018, at 12:00, via cfe-users <cfe-users@lists.llvm.org> wrote: > > Date: Mon, 24 Sep 2018 21:53:49 -0500 > From: David Blaikie via cfe-users <cfe-users@lists.llvm.org> > To: Alexander Biddulph <alexander.biddu...@uon.edu.au>, Eric > Christopher <echri...@gmail.com> > Cc: "cfe-users@lists.llvm.org" <cfe-users@lists.llvm.org> > Subject: Re: [cfe-users] Default compiler flags > Message-ID: > <CAENS6Ets=o_-95wglwv4o9tvb3blyilxcsaq4bemezb5qqz...@mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Don't know of any quick way to do that in LLVM - I guess companies/folks > who do this go into the source code in Clang's driver and mess with it. > > - Dave > > On Mon, Sep 17, 2018 at 10:10 PM Alexander Biddulph via cfe-users < > cfe-users@lists.llvm.org> wrote: > >> I am trying to compile clang/llvm to target a specific CPU architecture >> (Intel Broadwell for instance). The intention here is that every time this >> specific compiler is run it will only ever generate code for that specific >> CPU. >> >> To achieve this I would like to "bake-in" some command line arguments into >> the built compiler (things like -march), but still allow the user to >> provide extra command line arguments that may override the "baked-in" >> defaults. >> >> GCC provides a spec file to achieve this, but I can't find something >> equivalent for clang/llvm. Does such a thing exist for clang/llvm? >> _______________________________________________ >> cfe-users mailing list >> cfe-users@lists.llvm.org >> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users _______________________________________________ cfe-users mailing list cfe-users@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users