Clang and -frandom-seed

2010-11-14 Thread Erik Cederstrand
Hello toolchainers, I noticed that two consecutive builds of (GCC-built) Clang don't produce identical binaries. This is true for clang, clang++ and tblgen. I asked on the llvm-dev list yesterday, and it turns out it's because GCC uses a random seed on some symbols. Apparently, this can be cont

Re: Clang and -frandom-seed

2010-11-15 Thread Erik Cederstrand
Den 15/11/2010 kl. 00.10 skrev Dimitry Andric: > On 2010-11-14 23:29, Erik Cederstrand wrote: >> I noticed that two consecutive builds of (GCC-built) Clang don't produce >> identical binaries. This is true for clang, clang++ and tblgen. I asked on >> the llvm-dev li

Re: Clang and -frandom-seed

2010-11-19 Thread Erik Cederstrand
Den 15/11/2010 kl. 11.10 skrev Erik Cederstrand: > > Den 15/11/2010 kl. 00.10 skrev Dimitry Andric: > >> On 2010-11-14 23:29, Erik Cederstrand wrote: >>> I noticed that two consecutive builds of (GCC-built) Clang don't produce >>> identical binaries. This

Re: Clang and -frandom-seed

2010-11-22 Thread Erik Cederstrand
Den 21/11/2010 kl. 16.23 skrev Dimitry Andric: > On 2010-11-15 11:10, Erik Cederstrand wrote: > >> Where in the build scripts would I need to add this flag? Something like: >> >> CXXFLAGS += -frandom-seed=${.TARGET} > > Rather use: > > CXXFLAGS+=

Re: Clang and -frandom-seed

2010-11-22 Thread Erik Cederstrand
Den 22/11/2010 kl. 15.24 skrev Dimitry Andric: > Well, src.conf is only picked up if you .include , or > another bsd.*.mk file that includes bsd.own.mk in turn. > > So normally, you would have a Makefile in e.g. usr.bin/clang/clang, > which includes bsd.own.mk, and then includes clang.build.mk.

Re: Clang and -frandom-seed

2010-11-22 Thread Erik Cederstrand
Den 22/11/2010 kl. 15.47 skrev Erik Cederstrand: > Den 22/11/2010 kl. 15.24 skrev Dimitry Andric: > >> Well, src.conf is only picked up if you .include , or >> another bsd.*.mk file that includes bsd.own.mk in turn. >> >> So normally, you would have a Makefi

-integrated-as status?

2010-12-17 Thread Erik Cederstrand
Hello toolchainers, It is my understanding that -integrated-as is supposed to work for ELF on FreeBSD now. Is anybody working on supporting this flag for buildworld/kernel? I asked Michael Spencer about his work on the integrated linker (llvm-ld), but it's still in the design phase and won't ha

Re: -integrated-as status?

2010-12-17 Thread Erik Cederstrand
Den 17/12/2010 kl. 15.02 skrev Roman Divacky: > On Fri, Dec 17, 2010 at 02:58:34PM +0100, Erik Cederstrand wrote: >> Hello toolchainers, >> >> It is my understanding that -integrated-as is supposed to work for ELF on >> FreeBSD now. Is anybody working on supporting t

Analyzer scans

2011-06-06 Thread Erik Cederstrand
Hi everyone, It seems the static analysis scans at http://scan.freebsd.your.org/freebsd-head have vanished. Does anyone here know what happened to them? Thanks, Erik

Re: Adding additional llvm/clang goodies (was: Re: llvm-ia64 is off the ground...)

2011-06-17 Thread Erik Cederstrand
Den 16/06/2011 kl. 23.40 skrev Dimitry Andric: > Here is a diff to do just that, when you define WITH_CLANG_EXTRAS in > src.conf, in the environment, or on the make command line. In > particular, it will build and install the following extras: > > * bugpoint > * llc > * lli > * llvm-ar > * llvm-

Re: [RFC] Un-staticise the toolchain

2012-04-26 Thread Erik Cederstrand
Den 26/04/2012 kl. 11.35 skrev Konstantin Belousov: > I think it is time to stop building the toolchain static. I was told that > original reasoning for static linking was the fear of loosing the ability > to recompile if some problem appears with rtld and any required dynamic > library. Apparentl

[patch] Add "-iremap src:dst" option to gcc

2012-05-16 Thread Erik Cederstrand
Hi folks, I found this patch by Joerg Sonnenberger to NetBSD's gcc which adds an "-iremap src:dst" option to gcc (http://www.mail-archive.com/source-changes-full@netbsd.org/msg08590.html). The option rewrites the prefix to __FILE__ which is stored in the object file. My use-case is to make __F

MCLinker and llvm-config

2012-07-24 Thread Erik Cederstrand
Hi list, I'm creating a FreeBSD port for MCLinker (http://code.google.com/p/mclinker/) in preparation of MCLinker working without patching LLVM, and testing MCLinker as a system linker when it gets far enough. In the configure stage, MCLinker needs to run llvm-config, which is not installed by

Re: MCLinker and llvm-config

2012-07-24 Thread Erik Cederstrand
Hi Dimitry, Den 24/07/2012 kl. 11.15 skrev Dimitry Andric: > On 2012-07-24 11:02, Erik Cederstrand wrote: >> I'm creating a FreeBSD port for MCLinker >> (http://code.google.com/p/mclinker/) in preparation of MCLinker working >> without patching LLVM, and testing M

Re: MCLinker and llvm-config

2012-07-25 Thread Erik Cederstrand
Luba, Thanks for the update. Den 25/07/2012 kl. 11.22 skrev Luba Tang: > BTW, I think llvm-config is necessary for every LLVM-based project. If it > will not be in BSD system, I think we can negotiate an approach to get rid > of it. I created a FreeBSD port for llvm-config for testing MCLinker,

Linker flags used by buildworld/kernel

2012-07-27 Thread Erik Cederstrand
Hi guys, I want to know which linker flags are used when building FreeBSD, i.e. which flags a system linker must support. I created a wrapper for /usr/bin/ld that simply dumps the arguments to a file before calling /usr/bin/ld. I then added "LD=/path/to/wrapper" to /etc/make.conf and ran "make

Re: BSD ld (was Re: MCLinker and llvm-config)

2012-07-29 Thread Erik Cederstrand
Den 28/07/2012 kl. 16.15 skrev Pedro Giffuni: > Hello; > > The Elftoolchain project has been developing a BSD ld: > > http://sourceforge.net/apps/trac/elftoolchain/ > > > http://sourceforge.net/apps/trac/elftoolchain/browser/trunk/ld > > > I thought that would be the official FreeBSD imple

Re: BSD archive file formats

2012-08-06 Thread Erik Cederstrand
Den 03/08/2012 kl. 17.55 skrev Warner Losh: > Hi Pete, > > the best way to find out if support for archives are needed is to release it > for testing. People find the craziest things when testing in a wider arena. To do that, it would be helpful if our LLVM is updated to something later than

Re: Clang as default compiler November 4th

2012-09-11 Thread Erik Cederstrand
Roman, Den 11/09/2012 kl. 14.38 skrev Roman Divacky : > > Upstream developers almost never use gcc4.2.1 as we do. So right now the > ports maintainer must check whats wrong in the case the (upgraded) port > doesnt compile with our in-tree gcc. > > > It can be trivial USE_GCC=4.something but the

Re: Clang as default compiler November 4th

2012-09-12 Thread Erik Cederstrand
Den 12/09/2012 kl. 11.29 skrev Doug Barton : > On 09/11/2012 02:52 AM, Erik Cederstrand wrote: >> So can we do a sweep on the ports tree and mark the 2232 ports with >> USE_GCC=4.2 until they can actually build with clang? > > Unfortunately it isn't that simple. We al

arflags cleanup

2012-11-09 Thread Erik Cederstrand
Hello toolchainers, I'm attempting to clean up hardcoded ar(1) flags in the tree to use the global ARFLAGS in share/mk/sys.mk instead. I want to be able to add "-D" to ARFLAGS and have it used everywhere. The patch changes some hardcoded flags from e.g. "cru" to the default "rl" or "rv" from s

Re: arflags cleanup

2012-11-09 Thread Erik Cederstrand
Hello Warner, Den 09/11/2012 kl. 15.36 skrev Warner Losh : > On Nov 9, 2012, at 3:52 AM, Erik Cederstrand wrote: > >> Hello toolchainers, >> >> I'm attempting to clean up hardcoded ar(1) flags in the tree to use the >> global ARFLAGS in share/mk/sys.mk in

Re: arflags cleanup

2012-11-12 Thread Erik Cederstrand
Den 09/11/2012 kl. 16.22 skrev Erik Cederstrand : > Den 09/11/2012 kl. 15.36 skrev Warner Losh : > >> On Nov 9, 2012, at 3:52 AM, Erik Cederstrand wrote: >> >>> Hello toolchainers, >>> >>> I'm attempting to clean up hardcoded ar(1) flags in t

Re: arflags cleanup

2012-11-13 Thread Erik Cederstrand
Warner, Den 13/11/2012 kl. 03.26 skrev Warner Losh : >> >> If there are no other objections, I'll try to both patches into the tree (I >> have no commit bit myself). > > You haven't answered my objections, so not yet. I haven't had a chance to > see if this message actually answers my concern

Re: crunchide breaks object files when using mclinker to do base system linking

2012-11-27 Thread Erik Cederstrand
Den 27/11/2012 kl. 09.00 skrev pete : > Hi, > > I meet a problem when using mclinker to do base system linking. And the > problem is crunchide is gnu ld specific. it presumes the section layout of > a object file is like what gnu ld generates. > > To make it clear, gnu ld would generate the foll

Using non-standard linker

2012-12-13 Thread Erik Cederstrand
Hi folks, I'm working with Pete Chou from MCLinker (actually, he's doing almost all the work) to get mclinker to survive a buildworld. The goal is to allow mclinker to be a drop-in replacement for GNU ld. My first suggestion was to just add LD=/usr/local/bin/mclinker to src.conf. But this only

Re: Using non-standard linker

2012-12-13 Thread Erik Cederstrand
Den 13/12/2012 kl. 14.10 skrev David Chisnall : > Hi Eric, > > The easiest way of doing this is to make /usr/bin/ld (in the host system and > in the bootstrap) into a symbolic link that points to whatever the selected > linker is. I had to do this when testing gold as well (we end up with > l

Re: Using non-standard linker

2012-12-14 Thread Erik Cederstrand
Hello Warner, Den 13/12/2012 kl. 15.48 skrev Warner Losh : > > Install ld as ld.gnu during the build and after. Make ld a small shell > script that invokes ld.gnu by default, or something else if a variable is > set. Much like the way we have different mail backends to a common mail > front

[patch] DEBUG_FLAGS cleanup

2013-01-23 Thread Erik Cederstrand
Hello folks, Attached is a patch to clean up unconditional use of "-g" in Makefiles, instead respecting the global DEBUG_FLAGS setting. I need this as part of my quest to support deterministic builds. Currently, debug information contains stuff like timestamps, absolute paths etc. that make bi

Re: [patch] DEBUG_FLAGS cleanup

2013-01-23 Thread Erik Cederstrand
Den 23/01/2013 kl. 11.05 skrev Konstantin Belousov : > On Wed, Jan 23, 2013 at 09:23:41AM +0100, Erik Cederstrand wrote: >> [...] >> >> -CFLAGS+=-g >> +CFLAGS+=$(DEBUG_FLAGS) >> CFLAGS+= -DGENERATOR_FILE -DHAVE_CONFIG_H >> >> # Override

[patch] crunchide breaks object files when using mclinker to do base system linking

2013-01-25 Thread Erik Cederstrand
Hello list, On behalf of Pete Chou, I would like to ask for review, testing and hopefully commit help of this revised patch for crunchgen and crunchide which allows mclinker (http://code.google.com/p/mclinker/) to link the base system. In short, this patch is needed because crunchide is being o

Re: Miscellaneous questions

2013-05-03 Thread Erik Cederstrand
Den 03/05/2013 kl. 03.08 skrev Kennith Caudill : > 2.) Alternative linkers > > Is there a document available detailing the current feasible linkers and > their status? Not that I'm aware of. mclinker is work in progress and is not yet able to link the kernel. gold should work, but I'm not awar

Re: GCC withdraw

2013-08-25 Thread Erik Cederstrand
Den 25/08/2013 kl. 16.21 skrev Ian Lepore : >> Please file clang bugs at http://llvm.org/bugs/ > > And THIS is a major reason why FreeBSD needs a compiler in base instead > of all tools being ports. The last thing we need is to start responding > to every problem with "this is not my problem, g