Re: CLANG; still cc in use when building the WORLD with CLANG?
On 08/30/11 22:25, Kevin Oberman wrote: On Tue, Aug 30, 2011 at 12:34 PM, Hartmann, O. wrote: On 08/30/11 21:27, Kevin Oberman wrote: On Tue, Aug 30, 2011 at 11:13 AM, Hartmann, O. wrote: On 08/30/11 19:58, Dimitry Andric wrote: On 2011-08-30 18:44, Alex Kuster wrote: Thanks for pointing out those details ! This whole thing about make.conf& src.conf is very confusing and gives the impression of something half ported ... The only thing that is "half ported" at the moment, is an easy "use clang to build world" switch. This will be properly addressed after 9.0 is released. As to the make.conf/src.conf confusion, it is very simple really: - make.conf is used for system-wide settings, applied to every build using make. - src.conf is used for setting FreeBSD source tree settings, which are always of the form WITH_XXX or WITHOUT_XXX. See src.conf(5) for a full list. Any other "make" settings, such as CC, CFLAGS, etc, are better specified in make.conf, though the manpage does not tell you so explicitly. This is as I understood the manpage of src.conf. There is only a YES/set and NO/unset. No. There is only set and unset. WITH_option="NO" has the same effect as WITH_option="YES". I think this is confusing and often leads to unintended consequences, but I and also say that some of the WITH_options documented for src.conf (the man page is auto-generated from the code) are either non-functional or broken. I've had some interesting issues with unexpected interactions of WITH_options, as well. Be very careful! Sorry being so unprecise. I meant WITH_ and WITHOUT_. I learned the hard way that setting a variable to "be set" is simply done by naming it. Well, as I understand your comment, it seems that this /etc/src.conf facilty isn't working properly yet? That's a semantic issue. It works as designed in that setting an option in src.conf does set the specified flags for make in /usr/src. Unfortunately some of the options were added as options, but the code to actually make the option effective was not. The more popular options work fine...SENDMAIL, BIND, BSNMP, and many more. Most of those that are simple skips of doing a make on a given directory are fine, too. In fact, most are working as expected. Well, why not moving known working options of the src tree to the /etc/src.conf file and delete them from /etc/make.conf? Maybe this is a soft force to take more care of that? Just a suggestion. I like sometimes the more "radical" cut if things tend to get stuck. well, my OS is now compiling as expected with completely with CLANG. I missed some news in the list (I can't read everything, so I'm very grateful to people setting up the default config files). The problems are with more complex options that get involved with complex library dependencies. WITHOUT_SSH was broken for quite a while due to interactions with several other options. (Just look through the Makefiles involved in ssh and the complexity of the other cryto-related tools. It's not trivial and there are way too many options to fully test all possible combinations. (As far as I can tell, SSH issues are now resolved.) I will also point out that several options DO state that they have no effect in the man page, but that assumes people actually read the text associated with a given option. ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: CLANG; still cc in use when building the WORLD with CLANG?
On Tue, Aug 30, 2011 at 1:25 PM, Kevin Oberman wrote: > On Tue, Aug 30, 2011 at 12:34 PM, Hartmann, O. > wrote: >> On 08/30/11 21:27, Kevin Oberman wrote: >>> >>> On Tue, Aug 30, 2011 at 11:13 AM, Hartmann, O. >>> wrote: On 08/30/11 19:58, Dimitry Andric wrote: > > On 2011-08-30 18:44, Alex Kuster wrote: >> >> Thanks for pointing out those details ! >> This whole thing about make.conf& src.conf is very confusing and >> gives >> the >> impression of something half ported ... > > The only thing that is "half ported" at the moment, is an easy "use > clang to build world" switch. This will be properly addressed after 9.0 > is released. As to the make.conf/src.conf confusion, it is very simple > really: > > - make.conf is used for system-wide settings, applied to every build > using make. > > - src.conf is used for setting FreeBSD source tree settings, which are > always of the form WITH_XXX or WITHOUT_XXX. See src.conf(5) for a > full list. Any other "make" settings, such as CC, CFLAGS, etc, are > better specified in make.conf, though the manpage does not tell you > so explicitly. This is as I understood the manpage of src.conf. There is only a YES/set and NO/unset. >>> >>> No. There is only set and unset. WITH_option="NO" has the same effect as >>> WITH_option="YES". >>> >>> I think this is confusing and often leads to unintended >>> consequences, but I and also say that some of the WITH_options documented >>> for src.conf (the man page is auto-generated from the code) are either >>> non-functional or broken. I've had some interesting issues with unexpected >>> interactions of WITH_options, as well. Be very careful! >> >> Sorry being so unprecise. I meant WITH_ and WITHOUT_. I learned the hard way >> that setting a variable >> to "be set" is simply done by naming it. >> >> Well, as I understand your comment, it seems that this /etc/src.conf facilty >> isn't working properly yet? > > That's a semantic issue. It works as designed in that setting an > option in src.conf > does set the specified flags for make in /usr/src. Unfortunately some > of the options > were added as options, but the code to actually make the option > effective was not. > The more popular options work fine...SENDMAIL, BIND, BSNMP, and many more. > Most of those that are simple skips of doing a make on a given > directory are fine, too. > In fact, most are working as expected. > > The problems are with more complex options that get involved with > complex library > dependencies. WITHOUT_SSH was broken for quite a while due to interactions > with several other options. (Just look through the Makefiles involved > in ssh and the > complexity of the other cryto-related tools. It's not trivial and > there are way too many > options to fully test all possible combinations. (As far as I can > tell, SSH issues are now > resolved.) > > I will also point out that several options DO state that they have no > effect in the man > page, but that assumes people actually read the text associated with a > given option. And there are some options which are truly just broken (or simply put -- don't disable / enable things properly). See http://phk.freebsd.dk/misc/stable7_build_options/ for an initial idea (there's another one hanging around in another FreeBSD dev's public directory -- I forget whom exactly). HTH, -Garrett ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: CLANG; still cc in use when building the WORLD with CLANG?
On Tue, Aug 30, 2011 at 12:34 PM, Hartmann, O. wrote: > On 08/30/11 21:27, Kevin Oberman wrote: >> >> On Tue, Aug 30, 2011 at 11:13 AM, Hartmann, O. >> wrote: >>> >>> On 08/30/11 19:58, Dimitry Andric wrote: On 2011-08-30 18:44, Alex Kuster wrote: > > Thanks for pointing out those details ! > This whole thing about make.conf& src.conf is very confusing and > gives > the > impression of something half ported ... The only thing that is "half ported" at the moment, is an easy "use clang to build world" switch. This will be properly addressed after 9.0 is released. As to the make.conf/src.conf confusion, it is very simple really: - make.conf is used for system-wide settings, applied to every build using make. - src.conf is used for setting FreeBSD source tree settings, which are always of the form WITH_XXX or WITHOUT_XXX. See src.conf(5) for a full list. Any other "make" settings, such as CC, CFLAGS, etc, are better specified in make.conf, though the manpage does not tell you so explicitly. >>> >>> This is as I understood the manpage of src.conf. There is only a YES/set >>> and >>> NO/unset. >> >> No. There is only set and unset. WITH_option="NO" has the same effect as >> WITH_option="YES". >> >> I think this is confusing and often leads to unintended >> consequences, but I and also say that some of the WITH_options documented >> for src.conf (the man page is auto-generated from the code) are either >> non-functional or broken. I've had some interesting issues with unexpected >> interactions of WITH_options, as well. Be very careful! > > Sorry being so unprecise. I meant WITH_ and WITHOUT_. I learned the hard way > that setting a variable > to "be set" is simply done by naming it. > > Well, as I understand your comment, it seems that this /etc/src.conf facilty > isn't working properly yet? That's a semantic issue. It works as designed in that setting an option in src.conf does set the specified flags for make in /usr/src. Unfortunately some of the options were added as options, but the code to actually make the option effective was not. The more popular options work fine...SENDMAIL, BIND, BSNMP, and many more. Most of those that are simple skips of doing a make on a given directory are fine, too. In fact, most are working as expected. The problems are with more complex options that get involved with complex library dependencies. WITHOUT_SSH was broken for quite a while due to interactions with several other options. (Just look through the Makefiles involved in ssh and the complexity of the other cryto-related tools. It's not trivial and there are way too many options to fully test all possible combinations. (As far as I can tell, SSH issues are now resolved.) I will also point out that several options DO state that they have no effect in the man page, but that assumes people actually read the text associated with a given option. -- R. Kevin Oberman, Network Engineer - Retired E-mail: kob6...@gmail.com ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: CLANG; still cc in use when building the WORLD with CLANG?
On 08/30/11 21:27, Kevin Oberman wrote: On Tue, Aug 30, 2011 at 11:13 AM, Hartmann, O. wrote: On 08/30/11 19:58, Dimitry Andric wrote: On 2011-08-30 18:44, Alex Kuster wrote: Thanks for pointing out those details ! This whole thing about make.conf&src.conf is very confusing and gives the impression of something half ported ... The only thing that is "half ported" at the moment, is an easy "use clang to build world" switch. This will be properly addressed after 9.0 is released. As to the make.conf/src.conf confusion, it is very simple really: - make.conf is used for system-wide settings, applied to every build using make. - src.conf is used for setting FreeBSD source tree settings, which are always of the form WITH_XXX or WITHOUT_XXX. See src.conf(5) for a full list. Any other "make" settings, such as CC, CFLAGS, etc, are better specified in make.conf, though the manpage does not tell you so explicitly. This is as I understood the manpage of src.conf. There is only a YES/set and NO/unset. No. There is only set and unset. WITH_option="NO" has the same effect as WITH_option="YES". I think this is confusing and often leads to unintended consequences, but I and also say that some of the WITH_options documented for src.conf (the man page is auto-generated from the code) are either non-functional or broken. I've had some interesting issues with unexpected interactions of WITH_options, as well. Be very careful! Sorry being so unprecise. I meant WITH_ and WITHOUT_. I learned the hard way that setting a variable to "be set" is simply done by naming it. Well, as I understand your comment, it seems that this /etc/src.conf facilty isn't working properly yet? ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: CLANG; still cc in use when building the WORLD with CLANG?
On Tue, Aug 30, 2011 at 11:13 AM, Hartmann, O. wrote: > On 08/30/11 19:58, Dimitry Andric wrote: >> >> On 2011-08-30 18:44, Alex Kuster wrote: >>> >>> Thanks for pointing out those details ! >>> This whole thing about make.conf& src.conf is very confusing and gives >>> the >>> impression of something half ported ... >> >> The only thing that is "half ported" at the moment, is an easy "use >> clang to build world" switch. This will be properly addressed after 9.0 >> is released. As to the make.conf/src.conf confusion, it is very simple >> really: >> >> - make.conf is used for system-wide settings, applied to every build >> using make. >> >> - src.conf is used for setting FreeBSD source tree settings, which are >> always of the form WITH_XXX or WITHOUT_XXX. See src.conf(5) for a >> full list. Any other "make" settings, such as CC, CFLAGS, etc, are >> better specified in make.conf, though the manpage does not tell you >> so explicitly. > > This is as I understood the manpage of src.conf. There is only a YES/set and > NO/unset. No. There is only set and unset. WITH_option="NO" has the same effect as WITH_option="YES". I think this is confusing and often leads to unintended consequences, but I and also say that some of the WITH_options documented for src.conf (the man page is auto-generated from the code) are either non-functional or broken. I've had some interesting issues with unexpected interactions of WITH_options, as well. Be very careful! -- R. Kevin Oberman, Network Engineer - Retired E-mail: kob6...@gmail.com ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: CLANG; still cc in use when building the WORLD with CLANG?
On 08/30/11 19:58, Dimitry Andric wrote: On 2011-08-30 18:44, Alex Kuster wrote: Thanks for pointing out those details ! This whole thing about make.conf& src.conf is very confusing and gives the impression of something half ported ... The only thing that is "half ported" at the moment, is an easy "use clang to build world" switch. This will be properly addressed after 9.0 is released. As to the make.conf/src.conf confusion, it is very simple really: - make.conf is used for system-wide settings, applied to every build using make. - src.conf is used for setting FreeBSD source tree settings, which are always of the form WITH_XXX or WITHOUT_XXX. See src.conf(5) for a full list. Any other "make" settings, such as CC, CFLAGS, etc, are better specified in make.conf, though the manpage does not tell you so explicitly. This is as I understood the manpage of src.conf. There is only a YES/set and NO/unset. Well, I might be wrong, but FreeBSD separates strictly the core operating system and the ports stuff. When it came to CLANG compiled core system and I read about src.conf, my intuitive thinking was that this is the long awaited separation from having everything mixed in /etc/make.conf (by the way, somehow I feel I would all the ports stuff, even it make.conf, looking for at /usr/local/etc/make.conf ...). Now, why do some settings, such as CFLAGS, in src.conf not always work correctly? Because src.conf is only read when bsd.own.mk is included (implicitly or explicitly) in a Makefile, and this is *not* always done at the start of the file. On the other hand, make.conf is read from /usr/share/sys.mk, which is automatically included before anything else is done. Take, for example, the Makefile for cp(1), in /usr/src/bin/cp (I prefixed line numbers for reference): 1: # @(#)Makefile8.1 (Berkeley) 5/31/93 2: # $FreeBSD: head/bin/cp/Makefile 192586 2009-05-22 15:56:43Z trasz $ 3: 4: PROG= cp 5: SRCS= cp.c utils.c 6: CFLAGS+= -DVM_AND_BUFFER_CACHE_SYNCHRONIZED -D_ACL_PRIVATE 7: 8: .include At line 1, make will already have read make.conf, picking up settings from it. Suppose it picks up "CFLAGS=-foo". At line 6, CFLAGS has several flags appended. Its value will then become "-foo -DVM_AND_BUFFER_CACHE_SYNCHRONIZED -D_ACL_PRIVATE". At line 8, bsd.prog.mk is read, which (through bsd.own.mk) belatedly reads src.conf. If you have a setting such as "CFLAGS=-bar" in it, this value will *override* the previous one, possibly having disastrous consequences. Great! Many thanks, this is a nice explanation. With such detailed info it's a bit easier to hunt down the mistakes I made for my own. Thanks again. Oliver ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: CLANG; still cc in use when building the WORLD with CLANG?
On 2011-08-30 18:44, Alex Kuster wrote: Thanks for pointing out those details ! This whole thing about make.conf& src.conf is very confusing and gives the impression of something half ported ... The only thing that is "half ported" at the moment, is an easy "use clang to build world" switch. This will be properly addressed after 9.0 is released. As to the make.conf/src.conf confusion, it is very simple really: - make.conf is used for system-wide settings, applied to every build using make. - src.conf is used for setting FreeBSD source tree settings, which are always of the form WITH_XXX or WITHOUT_XXX. See src.conf(5) for a full list. Any other "make" settings, such as CC, CFLAGS, etc, are better specified in make.conf, though the manpage does not tell you so explicitly. Now, why do some settings, such as CFLAGS, in src.conf not always work correctly? Because src.conf is only read when bsd.own.mk is included (implicitly or explicitly) in a Makefile, and this is *not* always done at the start of the file. On the other hand, make.conf is read from /usr/share/sys.mk, which is automatically included before anything else is done. Take, for example, the Makefile for cp(1), in /usr/src/bin/cp (I prefixed line numbers for reference): 1: # @(#)Makefile8.1 (Berkeley) 5/31/93 2: # $FreeBSD: head/bin/cp/Makefile 192586 2009-05-22 15:56:43Z trasz $ 3: 4: PROG= cp 5: SRCS= cp.c utils.c 6: CFLAGS+= -DVM_AND_BUFFER_CACHE_SYNCHRONIZED -D_ACL_PRIVATE 7: 8: .include At line 1, make will already have read make.conf, picking up settings from it. Suppose it picks up "CFLAGS=-foo". At line 6, CFLAGS has several flags appended. Its value will then become "-foo -DVM_AND_BUFFER_CACHE_SYNCHRONIZED -D_ACL_PRIVATE". At line 8, bsd.prog.mk is read, which (through bsd.own.mk) belatedly reads src.conf. If you have a setting such as "CFLAGS=-bar" in it, this value will *override* the previous one, possibly having disastrous consequences. ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: CLANG; still cc in use when building the WORLD with CLANG?
On 08/30/11 18:44, Alex Kuster wrote: Thanks for pointing out those details ! This whole thing about make.conf& src.conf is very confusing and gives the impression of something half ported ... I aggree. It is, indeed. Because I honestly though that src.conf was for freebsd sources as indicated by the manpage (and in fact, compiled sources that way without issues ... ¿?) Anyways, I'll read more about what you guys pointed me. Thanks again. I tried hard the last two hours and had no success compiling my world by setting up only /etc/src.conf. And even with only those things left in /etc/make.conf like "NO_WERROR" and "WERROR" I wasn't able to compile the system. I permuted now many options and I'm back to the suggestiosn from the Wiki. But that leaves me with a manual switching back to the old compiler when it comes to ports. From my "naive" perspective, it should be easy to sort things out without being an expert in how the whole system is dependend on some make-set variables. ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: CLANG; still cc in use when building the WORLD with CLANG?
On 08/30/11 18:20, Dimitry Andric wrote: On 2011-08-30 11:48, Hartmann, O. wrote: I'm building world with CLANG (or I pretend to do so). In my /etc/make.conf I use these lines: ### ### CLANG ### .if defined(USE_CLANG) .if !empty(.CURDIR:M/usr/src*) You should add "|| !empty(.CURDIR:M:/usr/obj*)" to this .if statement, because the build build process changes to directories inside /usr/obj for various steps. Alternatively, use the simpler: .if empty(.CURDIR:N/usr/src*:N/usr/obj*) Alternatively, just remove the statement, and use clang for everything, and help fix bugs in ports. :) :-) I would, if I did not desperately have to rely on a working box for now. I forgot the above addition. Will try it - or better, leave it alone and try helping buxfixing ... CFLAGS= -O3 -march=native -mtune=native -fno-strict-aliasing -pipe COPTFLAGS= -O3 -march=native -mtune=native -pipe Take care when using clang and -march=native, there are still some issues with it (search this mailing list for specifics). If anything goes wrong, first revert to the default CFLAGS and COPTFLAGS (e.g. comment them out), and try again. Yes, I know, but I never had problems on my older Core2 based chips. The newer laptop CPU, a Core-i5 "Lynnfield" does have issues. ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: CLANG; still cc in use when building the WORLD with CLANG?
Thanks for pointing out those details ! This whole thing about make.conf & src.conf is very confusing and gives the impression of something half ported ... Because I honestly though that src.conf was for freebsd sources as indicated by the manpage (and in fact, compiled sources that way without issues ... ¿?) Anyways, I'll read more about what you guys pointed me. Thanks again. ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: CLANG; still cc in use when building the WORLD with CLANG?
On 2011-08-30 11:48, Hartmann, O. wrote: I'm building world with CLANG (or I pretend to do so). In my /etc/make.conf I use these lines: ### ### CLANG ### .if defined(USE_CLANG) .if !empty(.CURDIR:M/usr/src*) You should add "|| !empty(.CURDIR:M:/usr/obj*)" to this .if statement, because the build build process changes to directories inside /usr/obj for various steps. Alternatively, use the simpler: .if empty(.CURDIR:N/usr/src*:N/usr/obj*) Alternatively, just remove the statement, and use clang for everything, and help fix bugs in ports. :) CFLAGS= -O3 -march=native -mtune=native -fno-strict-aliasing -pipe COPTFLAGS= -O3 -march=native -mtune=native -pipe Take care when using clang and -march=native, there are still some issues with it (search this mailing list for specifics). If anything goes wrong, first revert to the default CFLAGS and COPTFLAGS (e.g. comment them out), and try again. ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: CLANG; still cc in use when building the WORLD with CLANG?
On 08/30/11 15:14, Olivier Smedts wrote: 2011/8/30 Alex Kuster: I would also recommend you to move the clang stuff for base system where it belongs ( /etc/src.conf .. see src.conf(5) ). > From http://wiki.freebsd.org/BuildingFreeBSDWithClang Add the following lines to /etc/make.conf: .if !defined(CC) || ${CC} == "cc" CC=clang .endif .if !defined(CXX) || ${CXX} == "c++" CXX=clang++ .endif .if !defined(CPP) || ${CPP} == "cpp" CPP=clang -E .endif # Don't die on warnings NO_WERROR= WERROR= # Don't forget this when using Jails! NO_FSCHG= So make.conf seems to be the good place. But as the previous poster referred to, there was an issue with CURDIR settings which do not work properly anymore. The suggestions from the WIKI set a global use of CLANG, even for ports, which I do not want since many ports do not build properly or refuse to build when compiled with CLANG. And I don't want to switch/edit /etc/make.conf everytime I build a world and then edit back when doing simple daily/weekly port-upgrades. For the ease of use, in such a case the whole CLANG YES or NO switches/knobs/stuff should really be triggered only by /etc/src.conf, since this location intuitively suggests it is the right place (as my Emglish understanding of the manpage of src.conf(5) is correct and this place is the place for the WORLD's stuff). oh ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: CLANG; still cc in use when building the WORLD with CLANG?
On 08/30/11 12:09, Alex Kuster wrote: Hi, read this -> http://lists.freebsd.org/pipermail/freebsd-current/2011- August/thread.html#26468 Using the /etc/make.conf with CURDIR approach seems to be broken from some time now ... I would also recommend you to move the clang stuff for base system where it belongs ( /etc/src.conf .. see src.conf(5) ). ## # FreeBSD source tree config options .if !defined(NO_CLANG) CC=clang CXX=clang++ # Don't die on warnings NO_WERROR= WERROR= CFLAGS+="-O2" # Don't forget this when using Jails! #NO_FSCHG= .endif (That's more or less how my /etc/src.conf is ) With this setup only in /etc/src.conf, build process will die soon due to an unrecognized/unsused compiler option std99! I guess there is some NO_WERROR=/WERROR setting your /etc/make.conf left and that is why src.conf seems at the moment not the right place/only place to put things. or you could just change this : .if !empty(.CURDIR:M/usr/src*) to this : .if !empty(.CURDIR:M/usr/src*) || !empty(.CURDIR:M/usr/obj/*) Choose whatever you like. Cheers. ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: CLANG; still cc in use when building the WORLD with CLANG?
2011/8/30 Alex Kuster : > I would also recommend you to move the clang stuff for base system where it > belongs ( /etc/src.conf .. see src.conf(5) ). >From http://wiki.freebsd.org/BuildingFreeBSDWithClang Add the following lines to /etc/make.conf: .if !defined(CC) || ${CC} == "cc" CC=clang .endif .if !defined(CXX) || ${CXX} == "c++" CXX=clang++ .endif .if !defined(CPP) || ${CPP} == "cpp" CPP=clang -E .endif # Don't die on warnings NO_WERROR= WERROR= # Don't forget this when using Jails! NO_FSCHG= So make.conf seems to be the good place. -- Olivier Smedts _ ASCII ribbon campaign ( ) e-mail: oliv...@gid0.org - against HTML email & vCards X www: http://www.gid0.org - against proprietary attachments / \ "Il y a seulement 10 sortes de gens dans le monde : ceux qui comprennent le binaire, et ceux qui ne le comprennent pas." ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: CLANG; still cc in use when building the WORLD with CLANG?
On 08/30/11 12:09, Alex Kuster wrote: Hi, read this -> http://lists.freebsd.org/pipermail/freebsd-current/2011- August/thread.html#26468 Using the /etc/make.conf with CURDIR approach seems to be broken from some time now ... I would also recommend you to move the clang stuff for base system where it belongs ( /etc/src.conf .. see src.conf(5) ). My first inyutive intention was this stuff belongs to /etc/src.conf(5) but then I read that in /etc/src.conf there should be only varibales defined by YES or NO to trigger some knobs. And: I was told that the CLANG_ stuff belongs to /etc/make.conf since there were several dependencies triggered by make.conf which ist needed for a clean build. I'm really confused now! Thanks a lot anyway. ## # FreeBSD source tree config options .if !defined(NO_CLANG) CC=clang CXX=clang++ # Don't die on warnings NO_WERROR= WERROR= CFLAGS+="-O2" # Don't forget this when using Jails! #NO_FSCHG= .endif (That's more or less how my /etc/src.conf is ) or you could just change this : .if !empty(.CURDIR:M/usr/src*) to this : .if !empty(.CURDIR:M/usr/src*) || !empty(.CURDIR:M/usr/obj/*) Choose whatever you like. Cheers. ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: CLANG; still cc in use when building the WORLD with CLANG?
Hi, read this -> http://lists.freebsd.org/pipermail/freebsd-current/2011- August/thread.html#26468 Using the /etc/make.conf with CURDIR approach seems to be broken from some time now ... I would also recommend you to move the clang stuff for base system where it belongs ( /etc/src.conf .. see src.conf(5) ). > ## > # FreeBSD source tree config options > > .if !defined(NO_CLANG) > CC=clang > CXX=clang++ > > # Don't die on warnings > NO_WERROR= > WERROR= > > CFLAGS+="-O2" > > # Don't forget this when using Jails! > #NO_FSCHG= > .endif (That's more or less how my /etc/src.conf is ) or you could just change this : > .if !empty(.CURDIR:M/usr/src*) to this : > .if !empty(.CURDIR:M/usr/src*) || !empty(.CURDIR:M/usr/obj/*) Choose whatever you like. Cheers. -- -BEGIN GEEK CODE BLOCK- Version: 3.1 GCS/M/MU d-x s+:- !a C++(+++)@>$ UBLVS>$ P+ L+++() E- W++ N++(+++) o K- w--- !O- M-@ !V PS++@ PE? Y+ PGP+++ t- 5? X- R* tv-- b+ DI+ D+(++) G h-- r++@ z?** --END GEEK CODE BLOCK-- signature.asc Description: This is a digitally signed message part.
CLANG; still cc in use when building the WORLD with CLANG?
Hello. I'm building world with CLANG (or I pretend to do so). In my /etc/make.conf I use these lines: ### ### CLANG ### .if defined(USE_CLANG) .if !empty(.CURDIR:M/usr/src*) CFLAGS= -O3 -march=native -mtune=native -fno-strict-aliasing -pipe COPTFLAGS= -O3 -march=native -mtune=native -pipe .if !defined(CC) || ${CC} == "cc" CC=clang .endif .if !defined(CXX) || ${CXX} == "c++" CXX=clang++ .endif # Don't die on warnings NO_WERROR= WERROR= # Don't forget this when using Jails! NO_FSCHG= .endif .endif Somewhere at the top of the file I set USE_CLANG=yes Watching the build process of the kernel reveals that the system's build process still involves the cc when building some portions of the UFS, VFS and so on. As shown below, several essential portions of the kernel aren't built by clang, that includes VFS, NFS, UFS et cetera. Am I doing wrong? Or is this no accident and still wanted since FreeBSD doesn't build completely with CLANG? As far as I understood, the kernel and core system should be ready to be build with clang as a whole ... [...] right at the beginning of the build process ... cc -O2 -pipe -mtune=native -fno-strict-aliasing -march=native -std=c99 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -I/usr/src/sys/contrib/ipfilter -I/usr/src/sys/contrib/pf -I/usr/src/sys/dev/ath -I/usr/src/sys/dev/ath/ath_hal -I/usr/src/sys/contrib/ngatm -I/usr/src/sys/dev/twa -I/usr/src/sys/gnu/fs/xfs/FreeBSD -I/usr/src/sys/gnu/fs/xfs/FreeBSD/support -I/usr/src/sys/gnu/fs/xfs -I/usr/src/sys/dev/cxgb -I/usr/src/sys/dev/cxgbe -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -fno-omit-frame-pointer -mno-sse -mcmodel=kernel -mno-red-zone -mno-mmx -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -c /usr/src/sys/compat/ia32/ia32_genassym.c cc -c -O2 -pipe -mtune=native -fno-strict-aliasing -march=native -std=c99 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -I/usr/src/sys/contrib/ipfilter -I/usr/src/sys/contrib/pf -I/usr/src/sys/dev/ath -I/usr/src/sys/dev/ath/ath_hal -I/usr/src/sys/contrib/ngatm -I/usr/src/sys/dev/twa -I/usr/src/sys/gnu/fs/xfs/FreeBSD -I/usr/src/sys/gnu/fs/xfs/FreeBSD/support -I/usr/src/sys/gnu/fs/xfs -I/usr/src/sys/dev/cxgb -I/usr/src/sys/dev/cxgbe -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -fno-omit-frame-pointer -mno-sse -mcmodel=kernel -mno-red-zone -mno-mmx -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector /usr/src/sys/amd64/amd64/genassym.c awk -f /usr/src/sys/tools/vnode_if.awk /usr/src/sys/kern/vnode_if.src -h rpcgen -c /usr/src/sys/kgssapi/gssd.x -o gssd_xdr.c rpcgen -lM /usr/src/sys/kgssapi/gssd.x | grep -v string.h > gssd_clnt.c env NM='nm' sh /usr/src/sys/kern/genassym.sh ia32_genassym.o > ia32_assym.h NM='nm' sh /usr/src/sys/kern/genassym.sh genassym.o > assym.s cc -c -x assembler-with-cpp -DLOCORE -O2 -pipe -mtune=native -fno-strict-aliasing -march=native -std=c99 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -I/usr/src/sys/contrib/ipfilter -I/usr/src/sys/contrib/pf -I/usr/src/sys/dev/ath -I/usr/src/sys/dev/ath/ath_hal -I/usr/src/sys/contrib/ngatm -I/usr/src/sys/dev/twa -I/usr/src/sys/gnu/fs/xfs/FreeBSD -I/usr/src/sys/gnu/fs/xfs/FreeBSD/support -I/usr/src/sys/gnu/fs/xfs -I/usr/src/sys/dev/cxgb -I/usr/src/sys/dev/cxgbe -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -fno-omit-frame-pointer -mno-sse -mcmodel=kernel -mno-red-zone -mno-mmx -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -Werror /usr/src/sys/amd64/acpica/acpi_wakecode.S objcopy -S -O binary acpi_wakecode.o acpi_wakecode.bin nm -n --defined-only acpi_wakecode.o | while read offset dummy what; do echo "#define ${what} 0x${offset}"; done > acpi_wakedata.h file2c -sx 'static char wakecode[] =