Re: Clang now builds world and kernel, on i386 and amd64

2010-09-29 Thread Dimitry Andric

On 2010-09-29 02:28, Derek Tattersall wrote:

A test shell script using mktemp (1) works fine on current built with
clang today.  The clang case produces a filename with all A's rather
than the random letters expected.


I cannot reproduce this on a system compiled entirely with clang:

$ mktemp foo.XX
foo.MyUM5k
$ mktemp foo.XX
foo.YidMeT
$ mktemp foo.XX
foo.L27Cfz
$ mktemp foo.XX
foo.k3haLx

... and so on.  Can you post that test script, please?
___
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 now builds world and kernel, on i386 and amd64

2010-09-29 Thread Buganini
mktemp foo.XX works here
but perl's File::Temp is not working

when I tried to build editors/openoffice.org-3-devel, I got:
Error in tempdir() using /tmp/XX: Tried to get a new temp name
different to the previous value 50 times.
Something wrong with template?? (/tmp/XX) at
/usr/ports/editors/openoffice.org-3-devel/work/DEV300_m88/solenv/bin/build.pl
line 2282

and it seems that openoffice crashes after I make world with clang.
(not verified yet)


Buganini
___
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 now builds world and kernel, on i386 and amd64

2010-09-29 Thread Garrett Cooper
On Tue, Sep 28, 2010 at 11:43 PM, Dimitry Andric d...@freebsd.org wrote:
 On 2010-09-29 02:28, Derek Tattersall wrote:

 A test shell script using mktemp (1) works fine on current built with
 clang today.  The clang case produces a filename with all A's rather
 than the random letters expected.

 I cannot reproduce this on a system compiled entirely with clang:

 $ mktemp foo.XX
 foo.MyUM5k
 $ mktemp foo.XX
 foo.YidMeT
 $ mktemp foo.XX
 foo.L27Cfz
 $ mktemp foo.XX
 foo.k3haLx

 ... and so on.  Can you post that test script, please?

Please note your CPUTYPE and CFLAGS (for both those that had a problem
and those that didn't) there might be some evidence in there that
would help to resolve this issue with clang.
Thanks,
-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 now builds world and kernel, on i386 and amd64

2010-09-29 Thread Daniel Nebdal
On Wed, Sep 29, 2010 at 8:58 AM, Garrett Cooper gcoo...@freebsd.org wrote:
 On Tue, Sep 28, 2010 at 11:43 PM, Dimitry Andric d...@freebsd.org wrote:
 On 2010-09-29 02:28, Derek Tattersall wrote:

 A test shell script using mktemp (1) works fine on current built with
 clang today.  The clang case produces a filename with all A's rather
 than the random letters expected.

 I cannot reproduce this on a system compiled entirely with clang:

 $ mktemp foo.XX
 foo.MyUM5k
 $ mktemp foo.XX
 foo.YidMeT
 $ mktemp foo.XX
 foo.L27Cfz
 $ mktemp foo.XX
 foo.k3haLx

 ... and so on.  Can you post that test script, please?

 Please note your CPUTYPE and CFLAGS (for both those that had a problem
 and those that didn't) there might be some evidence in there that
 would help to resolve this issue with clang.
 Thanks,
 -Garrett


Works for me with random names; tested with the File::Temp script
posted earlier.

Amd64 on a Core2-family Xeon. In a make buildenv - environment I have
CPUTYPE='', and no CFLAGS set.
As for version, err. I csup-ed the code on Sep 24, and VERSION is
'FreeBSD 9.0-CURRENT amd64 900021' . How do you find the r-number
anyway?

I can grab today's version and see if it still works for me.


If it matters, the process was buildworld with gcc, installworld,
buildworld with clang, installworld.

--
Daniel Nebdal
___
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 now builds world and kernel, on i386 and amd64

2010-09-29 Thread Renato Botelho
On Wed, Sep 29, 2010 at 3:43 AM, Dimitry Andric d...@freebsd.org wrote:
 On 2010-09-29 02:28, Derek Tattersall wrote:

 A test shell script using mktemp (1) works fine on current built with
 clang today.  The clang case produces a filename with all A's rather
 than the random letters expected.

 I cannot reproduce this on a system compiled entirely with clang:

 $ mktemp foo.XX
 foo.MyUM5k
 $ mktemp foo.XX
 foo.YidMeT
 $ mktemp foo.XX
 foo.L27Cfz
 $ mktemp foo.XX
 foo.k3haLx

 ... and so on.  Can you post that test script, please?


I'm using perl 5.12.2_2 and this is the code to reproduce
the problem. I didn't tested with other perl versions because
it's a hard task to move to another perl.

#!/usr/bin/perl

use File::Temp;

my ( $fh, $filename ) = File::Temp::tempfile();
print $filename\n;


-- 
Renato Botelho
___
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 now builds world and kernel, on i386 and amd64

2010-09-29 Thread Renato Botelho
On Wed, Sep 29, 2010 at 3:58 AM, Garrett Cooper gcoo...@freebsd.org wrote:
 On Tue, Sep 28, 2010 at 11:43 PM, Dimitry Andric d...@freebsd.org wrote:
 On 2010-09-29 02:28, Derek Tattersall wrote:

 A test shell script using mktemp (1) works fine on current built with
 clang today.  The clang case produces a filename with all A's rather
 than the random letters expected.

 I cannot reproduce this on a system compiled entirely with clang:

 $ mktemp foo.XX
 foo.MyUM5k
 $ mktemp foo.XX
 foo.YidMeT
 $ mktemp foo.XX
 foo.L27Cfz
 $ mktemp foo.XX
 foo.k3haLx

 ... and so on.  Can you post that test script, please?

 Please note your CPUTYPE and CFLAGS (for both those that had a problem
 and those that didn't) there might be some evidence in there that
 would help to resolve this issue with clang.

I just have this on my src.conf:

.if !defined(CC) || ${CC} == cc
CC=clang
.endif
.if !defined(CXX) || ${CXX} == c++
CXX=clang++
.endif
# Don't die on warnings
NO_WERROR=
WERROR=

-- 
Renato Botelho
___
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 now builds world and kernel, on i386 and amd64

2010-09-29 Thread Renato Botelho
On Wed, Sep 29, 2010 at 3:56 AM, Buganini bugan...@gmail.com wrote:
 mktemp foo.XX works here
 but perl's File::Temp is not working

 when I tried to build editors/openoffice.org-3-devel, I got:
 Error in tempdir() using /tmp/XX: Tried to get a new temp name
 different to the previous value 50 times.
 Something wrong with template?? (/tmp/XX) at
 /usr/ports/editors/openoffice.org-3-devel/work/DEV300_m88/solenv/bin/build.pl
 line 2282

Exactly thge same way I discovered the problem here.

-- 
Renato Botelho
___
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 now builds world and kernel, on i386 and amd64

2010-09-29 Thread Dimitry Andric

On 2010-09-29 13:23, Renato Botelho wrote:

#!/usr/bin/perl

use File::Temp;

my ( $fh, $filename ) = File::Temp::tempfile();
print $filename\n;


For me it works perfectly, though I am using perl 5.10:

$ cat foo.pl
#!/usr/bin/perl

use File::Temp;

my ( $fh, $filename ) = File::Temp::tempfile();
print $filename\n;
$ perl -v

This is perl, v5.10.1 (*) built for i386-freebsd-64int

Copyright 1987-2009, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using man perl or perldoc perl.  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

$ perl foo.pl
/tmp/tv25CPnWhF
$ perl foo.pl
/tmp/L2UJQ5_JJs
$ perl foo.pl
/tmp/6ynQYvWIc1
$ perl foo.pl
/tmp/Tdpf7PKBMg
$ perl foo.pl
/tmp/76ir2i1ici
$ perl foo.pl
/tmp/LhfD0eZgd8

I'll try building perl 5.12 and try it again.

Btw, I assume you did *not* rebuild perl with clang, so your perl is
still compiled with gcc?
___
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 now builds world and kernel, on i386 and amd64

2010-09-29 Thread Derek Tattersall
* Dimitry Andric d...@freebsd.org [100929 06:16]:
 On 2010-09-29 02:28, Derek Tattersall wrote:
  A test shell script using mktemp (1) works fine on current built with
  clang today.  The clang case produces a filename with all A's rather
  than the random letters expected.
 
 I cannot reproduce this on a system compiled entirely with clang:
 
 $ mktemp foo.XX
 foo.MyUM5k
 $ mktemp foo.XX
 foo.YidMeT
 $ mktemp foo.XX
 foo.L27Cfz
 $ mktemp foo.XX
 foo.k3haLx
 
 ... and so on.  Can you post that test script, please?
I think was ambiguous in description of the test I ran.  The mktemp
shell script test only had a call to /usr/bin/mktemp.  The other case I
ran, was Renato's perl script, and it produced the same results as he
produced.  I haven't had time yet to study the File::Temp code installed
by perl 5.12.2.
-- 
Best regards,
Derek Tattersall
d...@mebtel.net dlt...@yahoo.com dtatt...@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 now builds world and kernel, on i386 and amd64

2010-09-29 Thread Renato Botelho
On Wed, Sep 29, 2010 at 8:34 AM, Dimitry Andric d...@freebsd.org wrote:
 On 2010-09-29 13:23, Renato Botelho wrote:

 #!/usr/bin/perl

 use File::Temp;

 my ( $fh, $filename ) = File::Temp::tempfile();
 print $filename\n;

 For me it works perfectly, though I am using perl 5.10:

 $ cat foo.pl
 #!/usr/bin/perl

 use File::Temp;

 my ( $fh, $filename ) = File::Temp::tempfile();
 print $filename\n;
 $ perl -v

 This is perl, v5.10.1 (*) built for i386-freebsd-64int

 Copyright 1987-2009, Larry Wall

 Perl may be copied only under the terms of either the Artistic License or
 the
 GNU General Public License, which may be found in the Perl 5 source kit.

 Complete documentation for Perl, including FAQ lists, should be found on
 this system using man perl or perldoc perl.  If you have access to the
 Internet, point your browser at http://www.perl.org/, the Perl Home Page.

 $ perl foo.pl
 /tmp/tv25CPnWhF
 $ perl foo.pl
 /tmp/L2UJQ5_JJs
 $ perl foo.pl
 /tmp/6ynQYvWIc1
 $ perl foo.pl
 /tmp/Tdpf7PKBMg
 $ perl foo.pl
 /tmp/76ir2i1ici
 $ perl foo.pl
 /tmp/LhfD0eZgd8

 I'll try building perl 5.12 and try it again.

 Btw, I assume you did *not* rebuild perl with clang, so your perl is
 still compiled with gcc?

Correct, i didn't build any port with clang.

-- 
Renato Botelho
___
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 now builds world and kernel, on i386 and amd64

2010-09-29 Thread Buganini
I'm using perl 5.10, on amd64
only enable clang in src.conf
no CPU nor CFLAGS settings in src.conf/make.conf

so it seems that the problem is perl-version independent?
perhaps amd64?



On Wed, Sep 29, 2010 at 7:46 PM, Derek Tattersall d...@mebtel.net wrote:
 * Dimitry Andric d...@freebsd.org [100929 06:16]:
 On 2010-09-29 02:28, Derek Tattersall wrote:
  A test shell script using mktemp (1) works fine on current built with
  clang today.  The clang case produces a filename with all A's rather
  than the random letters expected.

 I cannot reproduce this on a system compiled entirely with clang:

 $ mktemp foo.XX
 foo.MyUM5k
 $ mktemp foo.XX
 foo.YidMeT
 $ mktemp foo.XX
 foo.L27Cfz
 $ mktemp foo.XX
 foo.k3haLx

 ... and so on.  Can you post that test script, please?
 I think was ambiguous in description of the test I ran.  The mktemp
 shell script test only had a call to /usr/bin/mktemp.  The other case I
 ran, was Renato's perl script, and it produced the same results as he
 produced.  I haven't had time yet to study the File::Temp code installed
 by perl 5.12.2.
 --
 Best regards,
 Derek Tattersall
 d...@mebtel.net          dlt...@yahoo.com                 dtatt...@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

___
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 now builds world and kernel, on i386 and amd64

2010-09-29 Thread Renato Botelho
On Wed, Sep 29, 2010 at 8:50 AM, Buganini bugan...@gmail.com wrote:
 I'm using perl 5.10, on amd64
 only enable clang in src.conf
 no CPU nor CFLAGS settings in src.conf/make.conf

 so it seems that the problem is perl-version independent?
 perhaps amd64?

I didn't test on i386 but it seems to be a problem using world built
with clang + perl 5.12.

I booted here with kernel built woth clang and keeping world
built with gcc and no problems happened. The problem is in
some lib.

-- 
Renato Botelho
___
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 now builds world and kernel, on i386 and amd64

2010-09-29 Thread Derek Tattersall
* Garrett Cooper gcoo...@freebsd.org [100929 06:16]:
 On Tue, Sep 28, 2010 at 11:43 PM, Dimitry Andric d...@freebsd.org wrote:
  On 2010-09-29 02:28, Derek Tattersall wrote:
 
  A test shell script using mktemp (1) works fine on current built with
  clang today. ?The clang case produces a filename with all A's rather
  than the random letters expected.
 
  I cannot reproduce this on a system compiled entirely with clang:
 
  $ mktemp foo.XX
  foo.MyUM5k
  $ mktemp foo.XX
  foo.YidMeT
  $ mktemp foo.XX
  foo.L27Cfz
  $ mktemp foo.XX
  foo.k3haLx
 
  ... and so on. ?Can you post that test script, please?
 
 Please note your CPUTYPE and CFLAGS (for both those that had a problem
 and those that didn't) there might be some evidence in there that
 would help to resolve this issue with clang.
 Thanks,
 -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
The CPUTYPE and CFLAGS are set as by a GENERIC build.  The kernel
configuration file is vanilla GENERIC with scsi and PCI ethernet drivers
built as modules only. The uname is:
FreeBSD oriental.arm.org 9.0-CURRENT FreeBSD 9.0-CURRENT #23: Tue Sep 28 
11:06:43 EDT 2010 \
r...@oriental.arm.org:/usr/obj/usr/src/sys/ORIENTAL  amd64
-- 
Best regards,
Derek Tattersall
d...@mebtel.net dlt...@yahoo.com dtatt...@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 now builds world and kernel, on i386 and amd64

2010-09-29 Thread Renato Botelho
On Wed, Sep 29, 2010 at 8:34 AM, Dimitry Andric d...@freebsd.org wrote:
 On 2010-09-29 13:23, Renato Botelho wrote:

 #!/usr/bin/perl

 use File::Temp;

 my ( $fh, $filename ) = File::Temp::tempfile();
 print $filename\n;

 For me it works perfectly, though I am using perl 5.10:

 $ cat foo.pl
 #!/usr/bin/perl

 use File::Temp;

 my ( $fh, $filename ) = File::Temp::tempfile();
 print $filename\n;
 $ perl -v

 This is perl, v5.10.1 (*) built for i386-freebsd-64int

 Copyright 1987-2009, Larry Wall

 Perl may be copied only under the terms of either the Artistic License or
 the
 GNU General Public License, which may be found in the Perl 5 source kit.

 Complete documentation for Perl, including FAQ lists, should be found on
 this system using man perl or perldoc perl.  If you have access to the
 Internet, point your browser at http://www.perl.org/, the Perl Home Page.

 $ perl foo.pl
 /tmp/tv25CPnWhF
 $ perl foo.pl
 /tmp/L2UJQ5_JJs
 $ perl foo.pl
 /tmp/6ynQYvWIc1
 $ perl foo.pl
 /tmp/Tdpf7PKBMg
 $ perl foo.pl
 /tmp/76ir2i1ici
 $ perl foo.pl
 /tmp/LhfD0eZgd8

 I'll try building perl 5.12 and try it again.

 Btw, I assume you did *not* rebuild perl with clang, so your perl is
 still compiled with gcc?


Well, I find out where the problem is, now I have my entire
system built with gcc. After install libc.so.7 built with clang
the problem starts, installing same lib built with gcc the
problem stops.

How can I debug it to give you more information?

-- 
Renato Botelho
___
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 now builds world and kernel, on i386 and amd64

2010-09-29 Thread Renato Botelho
On Wed, Sep 29, 2010 at 9:40 AM, Renato Botelho rbga...@gmail.com wrote:
 On Wed, Sep 29, 2010 at 8:34 AM, Dimitry Andric d...@freebsd.org wrote:
 On 2010-09-29 13:23, Renato Botelho wrote:

 #!/usr/bin/perl

 use File::Temp;

 my ( $fh, $filename ) = File::Temp::tempfile();
 print $filename\n;

 For me it works perfectly, though I am using perl 5.10:

 $ cat foo.pl
 #!/usr/bin/perl

 use File::Temp;

 my ( $fh, $filename ) = File::Temp::tempfile();
 print $filename\n;
 $ perl -v

 This is perl, v5.10.1 (*) built for i386-freebsd-64int

 Copyright 1987-2009, Larry Wall

 Perl may be copied only under the terms of either the Artistic License or
 the
 GNU General Public License, which may be found in the Perl 5 source kit.

 Complete documentation for Perl, including FAQ lists, should be found on
 this system using man perl or perldoc perl.  If you have access to the
 Internet, point your browser at http://www.perl.org/, the Perl Home Page.

 $ perl foo.pl
 /tmp/tv25CPnWhF
 $ perl foo.pl
 /tmp/L2UJQ5_JJs
 $ perl foo.pl
 /tmp/6ynQYvWIc1
 $ perl foo.pl
 /tmp/Tdpf7PKBMg
 $ perl foo.pl
 /tmp/76ir2i1ici
 $ perl foo.pl
 /tmp/LhfD0eZgd8

 I'll try building perl 5.12 and try it again.

 Btw, I assume you did *not* rebuild perl with clang, so your perl is
 still compiled with gcc?


 Well, I find out where the problem is, now I have my entire
 system built with gcc. After install libc.so.7 built with clang
 the problem starts, installing same lib built with gcc the
 problem stops.

 How can I debug it to give you more information?

Re-sending to the list, here is a ktrace using built-with-clang
libc.so.7, when the error occours.

-- 
Renato Botelho
___
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 now builds world and kernel, on i386 and amd64

2010-09-29 Thread Renato Botelho
On Wed, Sep 29, 2010 at 10:12 AM, Renato Botelho rbga...@gmail.com wrote:
 On Wed, Sep 29, 2010 at 9:40 AM, Renato Botelho rbga...@gmail.com wrote:
 On Wed, Sep 29, 2010 at 8:34 AM, Dimitry Andric d...@freebsd.org wrote:
 On 2010-09-29 13:23, Renato Botelho wrote:

 #!/usr/bin/perl

 use File::Temp;

 my ( $fh, $filename ) = File::Temp::tempfile();
 print $filename\n;

 For me it works perfectly, though I am using perl 5.10:

 $ cat foo.pl
 #!/usr/bin/perl

 use File::Temp;

 my ( $fh, $filename ) = File::Temp::tempfile();
 print $filename\n;
 $ perl -v

 This is perl, v5.10.1 (*) built for i386-freebsd-64int

 Copyright 1987-2009, Larry Wall

 Perl may be copied only under the terms of either the Artistic License or
 the
 GNU General Public License, which may be found in the Perl 5 source kit.

 Complete documentation for Perl, including FAQ lists, should be found on
 this system using man perl or perldoc perl.  If you have access to the
 Internet, point your browser at http://www.perl.org/, the Perl Home Page.

 $ perl foo.pl
 /tmp/tv25CPnWhF
 $ perl foo.pl
 /tmp/L2UJQ5_JJs
 $ perl foo.pl
 /tmp/6ynQYvWIc1
 $ perl foo.pl
 /tmp/Tdpf7PKBMg
 $ perl foo.pl
 /tmp/76ir2i1ici
 $ perl foo.pl
 /tmp/LhfD0eZgd8

 I'll try building perl 5.12 and try it again.

 Btw, I assume you did *not* rebuild perl with clang, so your perl is
 still compiled with gcc?


 Well, I find out where the problem is, now I have my entire
 system built with gcc. After install libc.so.7 built with clang
 the problem starts, installing same lib built with gcc the
 problem stops.

 How can I debug it to give you more information?

 Re-sending to the list, here is a ktrace using built-with-clang
 libc.so.7, when the error occours.

Seems the list didn't like my attachment, so here is place to
get it - http://people.freebsd.org/~garga/ktrace-error.txt.gz

-- 
Renato Botelho
___
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 now builds world and kernel, on i386 and amd64

2010-09-29 Thread Roman Divacky
On Wed, Sep 29, 2010 at 09:40:18AM -0300, Renato Botelho wrote:
 On Wed, Sep 29, 2010 at 8:34 AM, Dimitry Andric d...@freebsd.org wrote:
  On 2010-09-29 13:23, Renato Botelho wrote:
 
  #!/usr/bin/perl
 
  use File::Temp;
 
  my ( $fh, $filename ) = File::Temp::tempfile();
  print $filename\n;
 
  For me it works perfectly, though I am using perl 5.10:
 
  $ cat foo.pl
  #!/usr/bin/perl
 
  use File::Temp;
 
  my ( $fh, $filename ) = File::Temp::tempfile();
  print $filename\n;
  $ perl -v
 
  This is perl, v5.10.1 (*) built for i386-freebsd-64int
 
  Copyright 1987-2009, Larry Wall
 
  Perl may be copied only under the terms of either the Artistic License or
  the
  GNU General Public License, which may be found in the Perl 5 source kit.
 
  Complete documentation for Perl, including FAQ lists, should be found on
  this system using man perl or perldoc perl. ?If you have access to the
  Internet, point your browser at http://www.perl.org/, the Perl Home Page.
 
  $ perl foo.pl
  /tmp/tv25CPnWhF
  $ perl foo.pl
  /tmp/L2UJQ5_JJs
  $ perl foo.pl
  /tmp/6ynQYvWIc1
  $ perl foo.pl
  /tmp/Tdpf7PKBMg
  $ perl foo.pl
  /tmp/76ir2i1ici
  $ perl foo.pl
  /tmp/LhfD0eZgd8
 
  I'll try building perl 5.12 and try it again.
 
  Btw, I assume you did *not* rebuild perl with clang, so your perl is
  still compiled with gcc?
 
 
 Well, I find out where the problem is, now I have my entire
 system built with gcc. After install libc.so.7 built with clang
 the problem starts, installing same lib built with gcc the
 problem stops.
 
 How can I debug it to give you more information?

renato, can you check if libc compiled with clang -O0 still exhibits
the bug?

thank you, roman
___
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 now builds world and kernel, on i386 and amd64

2010-09-29 Thread Renato Botelho
On Wed, Sep 29, 2010 at 11:06 AM, Roman Divacky rdiva...@freebsd.org wrote:

 renato, can you check if libc compiled with clang -O0 still exhibits
 the bug?

I got the following error when i try to build libc with -O0

clang -O2 -pipe -O0  -I/usr/src/lib/libc/include
-I/usr/src/lib/libc/../../include -I/usr/src/lib/libc/amd64 -DNLS
-D__DBINTERFACE_PRIVATE -I/usr/src/lib/libc/../../contrib/gdtoa
-DINET6 -I/usr/obj/usr/src/lib/libc -I/usr/src/lib/libc/resolv
-D_ACL_PRIVATE -DPOSIX_MISTAKE
-I/usr/src/lib/libc/../../contrib/tzcode/stdtime
-I/usr/src/lib/libc/stdtime -I/usr/src/lib/libc/locale -DBROKEN_DES
-DPORTMAP -DDES_BUILTIN -I/usr/src/lib/libc/rpc -DYP -DNS_CACHING
-DSYMBOL_VERSIONING -std=gnu99 -fstack-protector -Wsystem-headers
-Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c
/usr/src/lib/libc/amd64/gen/ldexp.c
clang: warning: argument unused during compilation: '-O2'
Assertion failed: (RegMap[RegOnTop]  StackTop), function moveToTop,
file 
/usr/src/lib/clang/libllvmx86codegen/../../../contrib/llvm/lib/Target/X86/X86FloatingPoint.cpp,
line 200.
Stack dump:
0.  Program arguments: /usr/bin/clang -cc1 -triple
x86_64-undermydesk-freebsd9.0 -S -disable-free -main-file-name ldexp.c
-mrelocation-model static -mdisable-fp-elim -mconstructor-aliases
-munwind-tables -target-cpu x86-64 -resource-dir /usr/lib/clang/2.8 -D
NLS -D __DBINTERFACE_PRIVATE -D INET6 -D _ACL_PRIVATE -D POSIX_MISTAKE
-D BROKEN_DES -D PORTMAP -D DES_BUILTIN -D YP -D NS_CACHING -D
SYMBOL_VERSIONING -I /usr/src/lib/libc/include -I
/usr/src/lib/libc/../../include -I /usr/src/lib/libc/amd64 -I
/usr/src/lib/libc/../../contrib/gdtoa -I /usr/obj/usr/src/lib/libc -I
/usr/src/lib/libc/resolv -I
/usr/src/lib/libc/../../contrib/tzcode/stdtime -I
/usr/src/lib/libc/stdtime -I /usr/src/lib/libc/locale -I
/usr/src/lib/libc/rpc -O0 -Wsystem-headers -Wall -Wno-format-y2k
-Wno-uninitialized -Wno-pointer-sign -std=gnu99 -ferror-limit 19
-fmessage-length 105 -stack-protector 1 -fgnu-runtime
-fdiagnostics-show-option -fcolor-diagnostics -o /tmp/cc-8DfzyK.s -x c
/usr/src/lib/libc/amd64/gen/ldexp.c
1.  eof parser at end of file
2.  Code generation
3.  Running pass 'X86 FP Stackifier' on function '@ldexp'
clang: error: clang frontend command failed due to signal 6 (use -v to
see invocation)
*** Error code 250

Removing -O0 from CFLAGS it builds fine. Am I doing something
wrong?

I added CFLAGS+=-O0 on /etc/make.conf, and

# cd /usr/src/lib/libc
# make clean  make clean  make cleandir
# make obj
# make depend
# make

Thanks
-- 
Renato Botelho
___
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 now builds world and kernel, on i386 and amd64

2010-09-29 Thread Derek Tattersall
* Dimitry Andric d...@freebsd.org [100929 08:55]:
 On 2010-09-29 13:23, Renato Botelho wrote:
  #!/usr/bin/perl
 
  use File::Temp;
 
  my ( $fh, $filename ) = File::Temp::tempfile();
  print $filename\n;
 
 For me it works perfectly, though I am using perl 5.10:
 
 $ cat foo.pl
 #!/usr/bin/perl
 
 use File::Temp;
 
 my ( $fh, $filename ) = File::Temp::tempfile();
 print $filename\n;
 $ perl -v
 
 This is perl, v5.10.1 (*) built for i386-freebsd-64int
 
 Copyright 1987-2009, Larry Wall
 
 Perl may be copied only under the terms of either the Artistic License or the
 GNU General Public License, which may be found in the Perl 5 source kit.
 
 Complete documentation for Perl, including FAQ lists, should be found on
 this system using man perl or perldoc perl.  If you have access to the
 Internet, point your browser at http://www.perl.org/, the Perl Home Page.
 
 $ perl foo.pl
 /tmp/tv25CPnWhF
 $ perl foo.pl
 /tmp/L2UJQ5_JJs
 $ perl foo.pl
 /tmp/6ynQYvWIc1
 $ perl foo.pl
 /tmp/Tdpf7PKBMg
 $ perl foo.pl
 /tmp/76ir2i1ici
 $ perl foo.pl
 /tmp/LhfD0eZgd8
 
 I'll try building perl 5.12 and try it again.
 
 Btw, I assume you did *not* rebuild perl with clang, so your perl is
 still compiled with gcc?
 ___
 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
I built a test case using perl 5.12 and demonstrated that calling int(rand())
in perl returns NAN, as does calling rand() by itself.  A C program
that calls libc's rand() does return differing integers.  The perl
documentation claims that perl's rand() calls Cs rand() and srand() if
necessary.  I think this effectively demonstrates that the problem lies
with the perl function rand() and it's interface to libc's rand() as
provided by clang.  

On a recent stable system, perl's mktemp works fine.  The only real
difference is that libc on stable is built with gcc and libc on current
is built with clang.

The perl source for mktemp() is in
/usr/local/lib/perl5/5.12.2/File/Temp.pm.  The line that builds the
filename from the template is line 632.
-- 
Best regards,
Derek Tattersall
d...@mebtel.net dlt...@yahoo.com dtatt...@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 now builds world and kernel, on i386 and amd64

2010-09-29 Thread Renato Botelho
On Wed, Sep 29, 2010 at 11:06 AM, Roman Divacky rdiva...@freebsd.org wrote:
 renato, can you check if libc compiled with clang -O0 still exhibits
 the bug?

Hi Roman,

I needed to build ldexp.{o,po,So} manually with -O2, and built every
other object using -O0, the same problem happened.

-- 
Renato Botelho
___
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 now builds world and kernel, on i386 and amd64

2010-09-29 Thread Roman Divacky
On Wed, Sep 29, 2010 at 11:56:59AM -0400, Derek Tattersall wrote:
 * Dimitry Andric d...@freebsd.org [100929 08:55]:
  On 2010-09-29 13:23, Renato Botelho wrote:
   #!/usr/bin/perl
  
   use File::Temp;
  
   my ( $fh, $filename ) = File::Temp::tempfile();
   print $filename\n;
  
  For me it works perfectly, though I am using perl 5.10:
  
  $ cat foo.pl
  #!/usr/bin/perl
  
  use File::Temp;
  
  my ( $fh, $filename ) = File::Temp::tempfile();
  print $filename\n;
  $ perl -v
  
  This is perl, v5.10.1 (*) built for i386-freebsd-64int
  
  Copyright 1987-2009, Larry Wall
  
  Perl may be copied only under the terms of either the Artistic License or 
  the
  GNU General Public License, which may be found in the Perl 5 source kit.
  
  Complete documentation for Perl, including FAQ lists, should be found on
  this system using man perl or perldoc perl.  If you have access to the
  Internet, point your browser at http://www.perl.org/, the Perl Home Page.
  
  $ perl foo.pl
  /tmp/tv25CPnWhF
  $ perl foo.pl
  /tmp/L2UJQ5_JJs
  $ perl foo.pl
  /tmp/6ynQYvWIc1
  $ perl foo.pl
  /tmp/Tdpf7PKBMg
  $ perl foo.pl
  /tmp/76ir2i1ici
  $ perl foo.pl
  /tmp/LhfD0eZgd8
  
  I'll try building perl 5.12 and try it again.
  
  Btw, I assume you did *not* rebuild perl with clang, so your perl is
  still compiled with gcc?
  ___
  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
 I built a test case using perl 5.12 and demonstrated that calling int(rand())
 in perl returns NAN, as does calling rand() by itself.  A C program
 that calls libc's rand() does return differing integers.  The perl
 documentation claims that perl's rand() calls Cs rand() and srand() if
 necessary.  I think this effectively demonstrates that the problem lies
 with the perl function rand() and it's interface to libc's rand() as
 provided by clang.  
 
 On a recent stable system, perl's mktemp works fine.  The only real
 difference is that libc on stable is built with gcc and libc on current
 is built with clang.

what does this show with clang libc?

perl -e 'print int(rand(60)) .  \n foreach (1 .. 10)'

I guess it returns all 0, as the $CHAR[0] is 'A', can you test that?
___
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 now builds world and kernel, on i386 and amd64

2010-09-29 Thread Dimitry Andric

On 2010-09-29 17:48, Renato Botelho wrote:

0.  Program arguments: /usr/bin/clang -cc1 -triple
x86_64-undermydesk-freebsd9.0 -S -disable-free -main-file-name ldexp.c
-mrelocation-model static -mdisable-fp-elim -mconstructor-aliases
-munwind-tables -target-cpu x86-64 -resource-dir /usr/lib/clang/2.8 -D
NLS -D __DBINTERFACE_PRIVATE -D INET6 -D _ACL_PRIVATE -D POSIX_MISTAKE
-D BROKEN_DES -D PORTMAP -D DES_BUILTIN -D YP -D NS_CACHING -D
SYMBOL_VERSIONING -I /usr/src/lib/libc/include -I
/usr/src/lib/libc/../../include -I /usr/src/lib/libc/amd64 -I
/usr/src/lib/libc/../../contrib/gdtoa -I /usr/obj/usr/src/lib/libc -I
/usr/src/lib/libc/resolv -I
/usr/src/lib/libc/../../contrib/tzcode/stdtime -I
/usr/src/lib/libc/stdtime -I /usr/src/lib/libc/locale -I
/usr/src/lib/libc/rpc -O0 -Wsystem-headers -Wall -Wno-format-y2k
-Wno-uninitialized -Wno-pointer-sign -std=gnu99 -ferror-limit 19
-fmessage-length 105 -stack-protector 1 -fgnu-runtime
-fdiagnostics-show-option -fcolor-diagnostics -o /tmp/cc-8DfzyK.s -x c
/usr/src/lib/libc/amd64/gen/ldexp.c
1.eof  parser at end of file
2.  Code generation
3.  Running pass 'X86 FP Stackifier' on function '@ldexp'

...

Removing -O0 from CFLAGS it builds fine. Am I doing something
wrong?


No, but unfortunately ldexp.c is well-known problem case for clang's
inline assembly support.  Its handling of floating point arguments is
rather fragile, and sometimes breaks, as you can see here.  For now,
only use the standard settings to compile it. :)
___
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 now builds world and kernel, on i386 and amd64

2010-09-29 Thread Renato Botelho
On Wed, Sep 29, 2010 at 2:31 PM, Roman Divacky rdiva...@freebsd.org wrote:
 On Wed, Sep 29, 2010 at 11:56:59AM -0400, Derek Tattersall wrote:
 * Dimitry Andric d...@freebsd.org [100929 08:55]:
  On 2010-09-29 13:23, Renato Botelho wrote:
   #!/usr/bin/perl
  
   use File::Temp;
  
   my ( $fh, $filename ) = File::Temp::tempfile();
   print $filename\n;
 
  For me it works perfectly, though I am using perl 5.10:
 
  $ cat foo.pl
  #!/usr/bin/perl
 
  use File::Temp;
 
  my ( $fh, $filename ) = File::Temp::tempfile();
  print $filename\n;
  $ perl -v
 
  This is perl, v5.10.1 (*) built for i386-freebsd-64int
 
  Copyright 1987-2009, Larry Wall
 
  Perl may be copied only under the terms of either the Artistic License or 
  the
  GNU General Public License, which may be found in the Perl 5 source kit.
 
  Complete documentation for Perl, including FAQ lists, should be found on
  this system using man perl or perldoc perl.  If you have access to the
  Internet, point your browser at http://www.perl.org/, the Perl Home Page.
 
  $ perl foo.pl
  /tmp/tv25CPnWhF
  $ perl foo.pl
  /tmp/L2UJQ5_JJs
  $ perl foo.pl
  /tmp/6ynQYvWIc1
  $ perl foo.pl
  /tmp/Tdpf7PKBMg
  $ perl foo.pl
  /tmp/76ir2i1ici
  $ perl foo.pl
  /tmp/LhfD0eZgd8
 
  I'll try building perl 5.12 and try it again.
 
  Btw, I assume you did *not* rebuild perl with clang, so your perl is
  still compiled with gcc?
  ___
  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
 I built a test case using perl 5.12 and demonstrated that calling int(rand())
 in perl returns NAN, as does calling rand() by itself.  A C program
 that calls libc's rand() does return differing integers.  The perl
 documentation claims that perl's rand() calls Cs rand() and srand() if
 necessary.  I think this effectively demonstrates that the problem lies
 with the perl function rand() and it's interface to libc's rand() as
 provided by clang.

 On a recent stable system, perl's mktemp works fine.  The only real
 difference is that libc on stable is built with gcc and libc on current
 is built with clang.

 what does this show with clang libc?

 perl -e 'print int(rand(60)) .  \n foreach (1 .. 10)'

 I guess it returns all 0, as the $CHAR[0] is 'A', can you test that?


r...@botelhor:/usr/src/lib/libc# perl -e 'print int(rand(60)) .  \n
foreach (1 .. 10)'
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan

-- 
Renato Botelho
___
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 now builds world and kernel, on i386 and amd64

2010-09-29 Thread Roman Divacky
On Wed, Sep 29, 2010 at 02:41:17PM -0300, Renato Botelho wrote:
 On Wed, Sep 29, 2010 at 2:31 PM, Roman Divacky rdiva...@freebsd.org wrote:
  On Wed, Sep 29, 2010 at 11:56:59AM -0400, Derek Tattersall wrote:
  * Dimitry Andric d...@freebsd.org [100929 08:55]:
   On 2010-09-29 13:23, Renato Botelho wrote:
#!/usr/bin/perl
   
use File::Temp;
   
my ( $fh, $filename ) = File::Temp::tempfile();
print $filename\n;
  
   For me it works perfectly, though I am using perl 5.10:
  
   $ cat foo.pl
   #!/usr/bin/perl
  
   use File::Temp;
  
   my ( $fh, $filename ) = File::Temp::tempfile();
   print $filename\n;
   $ perl -v
  
   This is perl, v5.10.1 (*) built for i386-freebsd-64int
  
   Copyright 1987-2009, Larry Wall
  
   Perl may be copied only under the terms of either the Artistic License 
   or the
   GNU General Public License, which may be found in the Perl 5 source kit.
  
   Complete documentation for Perl, including FAQ lists, should be found on
   this system using man perl or perldoc perl. ?If you have access to 
   the
   Internet, point your browser at http://www.perl.org/, the Perl Home Page.
  
   $ perl foo.pl
   /tmp/tv25CPnWhF
   $ perl foo.pl
   /tmp/L2UJQ5_JJs
   $ perl foo.pl
   /tmp/6ynQYvWIc1
   $ perl foo.pl
   /tmp/Tdpf7PKBMg
   $ perl foo.pl
   /tmp/76ir2i1ici
   $ perl foo.pl
   /tmp/LhfD0eZgd8
  
   I'll try building perl 5.12 and try it again.
  
   Btw, I assume you did *not* rebuild perl with clang, so your perl is
   still compiled with gcc?
   ___
   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
  I built a test case using perl 5.12 and demonstrated that calling 
  int(rand())
  in perl returns NAN, as does calling rand() by itself. ?A C program
  that calls libc's rand() does return differing integers. ?The perl
  documentation claims that perl's rand() calls Cs rand() and srand() if
  necessary. ?I think this effectively demonstrates that the problem lies
  with the perl function rand() and it's interface to libc's rand() as
  provided by clang.
 
  On a recent stable system, perl's mktemp works fine. ?The only real
  difference is that libc on stable is built with gcc and libc on current
  is built with clang.
 
  what does this show with clang libc?
 
  perl -e 'print int(rand(60)) .  \n foreach (1 .. 10)'
 
  I guess it returns all 0, as the $CHAR[0] is 'A', can you test that?
 
 
 r...@botelhor:/usr/src/lib/libc# perl -e 'print int(rand(60)) .  \n
 foreach (1 .. 10)'
 nan
 nan
 nan
 nan
 nan
 nan
 nan
 nan
 nan
 nan

heh, now I noticed that Derek already wrote that ;) is anyone able
to find where in perl sources the rand function is defined? I failed
that :(
___
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 now builds world and kernel, on i386 and amd64

2010-09-29 Thread Renato Botelho
On Wed, Sep 29, 2010 at 2:44 PM, Roman Divacky rdiva...@freebsd.org wrote:
 heh, now I noticed that Derek already wrote that ;) is anyone able
 to find where in perl sources the rand function is defined? I failed
 that :(

It's using drand48() instead of rand()

r...@botelhor:/usr/ports/lang/perl5.12# make configure | grep -i rand
drand48_r() NOT found.
random_r() NOT found.
srand48_r() NOT found.
srandom_r() NOT found.
Looking for a random number function...
Good, found drand48().
Use which function to generate random numbers? [drand48]
Checking how to generate random libraries on your machine...

Test results here:

GCC libc:
ga...@botelhor:~/testes ./test
random value 0.396465

clang libc:
ga...@botelhor:~/testes ./test
random value -inf

Source of test.c:

#include stdlib.h
#include stdio.h
#include string.h

int main() {
printf(random value %f\n, drand48());
exit(0);
}

-- 
Renato Botelho
___
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 now builds world and kernel, on i386 and amd64

2010-09-29 Thread Dimitry Andric

On 2010-09-29 20:22, Renato Botelho wrote:

It's using drand48() instead of rand()

...

GCC libc:
ga...@botelhor:~/testes  ./test
random value 0.396465

clang libc:
ga...@botelhor:~/testes  ./test
random value -inf


Renato, Derek, could you please apply the attached patch for ldexp,
rebuild your libc (with clang), and run your random test program again?
diff --git a/lib/libc/amd64/gen/ldexp.c b/lib/libc/amd64/gen/ldexp.c
index 43107fc..ecf1ff8 100644
--- a/lib/libc/amd64/gen/ldexp.c
+++ b/lib/libc/amd64/gen/ldexp.c
@@ -36,6 +36,8 @@ static char sccsid[] = @(#)ldexp.c   8.1 (Berkeley) 6/4/93;
 #include sys/cdefs.h
 __FBSDID($FreeBSD$);
 
+#include math.h
+
 /*
  * ldexp(value, exp): return value * (2 ** exp).
  *
@@ -49,12 +51,16 @@ __FBSDID($FreeBSD$);
 double
 ldexp (double value, int exp)
 {
-   double temp, texp, temp2;
+   double temp, texp;
+#ifdef __clang__
+   volatile
+#endif
+   double temp2;
texp = exp;
 #ifdef __GNUC__
__asm (fscale 
-   : =u (temp2), =t (temp)
-   : 0 (texp), 1 (value));
+   : =t (temp), =u (temp2)
+   : 0 (value), 1 (texp));
 #else
 #error unknown asm
 #endif
___
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 now builds world and kernel, on i386 and amd64

2010-09-29 Thread Renato Botelho
On Wed, Sep 29, 2010 at 4:35 PM, Dimitry Andric d...@freebsd.org wrote:
 On 2010-09-29 20:22, Renato Botelho wrote:

 It's using drand48() instead of rand()

 ...

 GCC libc:
 ga...@botelhor:~/testes  ./test
 random value 0.396465

 clang libc:
 ga...@botelhor:~/testes  ./test
 random value -inf

 Renato, Derek, could you please apply the attached patch for ldexp,
 rebuild your libc (with clang), and run your random test program again?



Worked perfectly here \o/

Thank you
-- 
Renato Botelho
___
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 now builds world and kernel, on i386 and amd64

2010-09-29 Thread Dimitry Andric

On 2010-09-29 21:47, Renato Botelho wrote:

Renato, Derek, could you please apply the attached patch for ldexp,
rebuild your libc (with clang), and run your random test program again?


Worked perfectly here \o/


And what about perl? :)
___
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 now builds world and kernel, on i386 and amd64

2010-09-29 Thread Renato Botelho
On Wed, Sep 29, 2010 at 4:49 PM, Dimitry Andric d...@freebsd.org wrote:
 On 2010-09-29 21:47, Renato Botelho wrote:

 Renato, Derek, could you please apply the attached patch for ldexp,
 rebuild your libc (with clang), and run your random test program again?

 Worked perfectly here \o/

 And what about perl? :)


Just fine :)

ga...@botelhor:~/testes perl tmp.pl
/tmp/_68PLsxOhY
ga...@botelhor:~/testes perl tmp.pl
/tmp/XUQhE_7DKY
ga...@botelhor:~/testes perl tmp.pl
/tmp/8VyPZdAWD7
ga...@botelhor:~/testes perl tmp.pl
/tmp/3bdOmoPhL2


-- 
Renato Botelho
___
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 now builds world and kernel, on i386 and amd64

2010-09-29 Thread Derek Tattersall
* Dimitry Andric d...@freebsd.org [100929 17:05]:
 On 2010-09-29 21:47, Renato Botelho wrote:
  Renato, Derek, could you please apply the attached patch for ldexp,
  rebuild your libc (with clang), and run your random test program again?
 
  Worked perfectly here \o/
 
 And what about perl? :)
Super!  Thanks very much for this rapid fix.  And perldoc -f works
again.
-- 
Best regards,
Derek Tattersall
d...@mebtel.net dlt...@yahoo.com dtatt...@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 now builds world and kernel, on i386 and amd64

2010-09-28 Thread Olivier Smedts
2010/9/27 Olivier Smedts oliv...@gid0.org:
 2010/9/27 Olivier Smedts oliv...@gid0.org:
 2010/9/27 Dimitry Andric d...@freebsd.org:
 On 2010-09-27 09:32, Olivier Smedts wrote:

 2010/9/23 Bartosz Stecad...@kkip.pl:

 ...

 Assertion failed: (false  Ran out of registers during register
 allocation!), function assignRegOrStackSlotAtInterval, file

 /usr/src/lib/clang/libllvmcodegen/../../../contrib/llvm/lib/CodeGen/RegAllocLinearScan.cpp,
 line 1196.

 ...

 Same error here with yesterday's -CURRENT, but not at the same time
 (the running system was compiled using gcc) :

 As with Bartosz, could you please remove the CPU-specific flags from
 make.conf, and try again?

 Ok, I'll post the results later (it was the same with -DNDEBUG).

 Was not OK with :
 CPUTYPE=athlon-xp
 CFLAGS=-O2 -pipe -march=native -fomit-frame-pointer
 NO_CPU_CFLAGS=yes
 COPTFLAGS=-O2 -pipe -march=native -fomit-frame-pointer
 NO_CPU_COPTFLAGS=yes

 Is OK with :
 CPUTYPE=athlon-xp
 CFLAGS=-O2 -pipe -fomit-frame-pointer
 NO_CPU_CFLAGS=yes
 COPTFLAGS=-O2 -pipe -fomit-frame-pointer
 NO_CPU_COPTFLAGS=yes

 I'll try with other -march (i686 and athlon) and post results.

So, with -march=athlon, buildworld is ok.

With -march=athlon -msse or -march=athlon-xp or -march=native,
buildworld fails here :
clang -c -O2 -pipe -march=athlon -msse -fomit-frame-pointer -DIN_GCC
-DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -DHAVE_GTHR_DEFAULT
-I/usr/src/gnu/lib/libgcc/../../../contrib/gcclibs/include
-I/usr/src/gnu/lib/libgcc/../../../contrib/gcc/config
-I/usr/src/gnu/lib/libgcc/../../../contrib/gcc -I.
-I/usr/src/gnu/lib/libgcc/../../usr.bin/cc/cc_tools -std=gnu99
-fvisibility=hidden -DHIDE_EXPORTS -fPIC -fexceptions -D__GLIBC__=3
-DElfW=__ElfN -o unwind-dw2.o
/usr/src/gnu/lib/libgcc/../../../contrib/gcc/unwind-dw2.c
Assertion failed: (!spillIs.empty()  No spill intervals?),
function assignRegOrStackSlotAtInterval, file
/usr/src/lib/clang/libllvmcodegen/../../../contrib/llvm/lib/CodeGen/RegAllocLinearScan.cpp,
line 1287.
Stack dump:
0.  Program arguments: /usr/obj/usr/src/tmp/usr/bin/clang -cc1
-triple i386-undermydesk-freebsd9.0 -S -disable-free -main-file-name
unwind-dw2.c -pic-level 2 -mconstructor-aliases -target-cpu athlon
-target-feature +sse -resource-dir
/usr/obj/usr/src/tmp/usr/lib/clang/2.8 -D IN_GCC -D IN_LIBGCC2 -D
__GCC_FLOAT_NOT_NEEDED -D HAVE_GTHR_DEFAULT -D HIDE_EXPORTS -D
__GLIBC__=3 -D ElfW=__ElfN -I
/usr/src/gnu/lib/libgcc/../../../contrib/gcclibs/include -I
/usr/src/gnu/lib/libgcc/../../../contrib/gcc/config -I
/usr/src/gnu/lib/libgcc/../../../contrib/gcc -I . -I
/usr/src/gnu/lib/libgcc/../../usr.bin/cc/cc_tools -O2 -std=gnu99
-ferror-limit 19 -fmessage-length 118 -fvisibility hidden -fexceptions
-fgnu-runtime -fdiagnostics-show-option -fcolor-diagnostics -o
/tmp/cc-CfyzYr.s -x c
/usr/src/gnu/lib/libgcc/../../../contrib/gcc/unwind-dw2.c
1.  eof parser at end of file
2.  Code generation
3.  Running pass 'Linear Scan Register Allocator' on function
'@_Unwind_GetGR'
clang: error: clang frontend command failed due to signal 6 (use -v to
see invocation)
*** Error code 250
Stop in /usr/src/gnu/lib/libgcc.

But if I
# cd /usr/src/gnu/lib/libgcc
# make
then unwind-dw2.c compiles fine.

So the problem seems to be with clang
(/usr/obj/usr/src/tmp/usr/bin/clang) when compiled with SSE on Athlon.
Can't try with AMD k8 or Intel CPUs, my core2 follows -STABLE.


 I guess there is something borked in LLVM's Athlon optimization, so it
 is probably better to not try to tickly those bugs for now.


 # grep -vE '^#|^$' /etc/make.conf
 KERNCONF=XPC
 CPUTYPE=athlon-xp
 CFLAGS=-O2 -pipe -march=native -fomit-frame-pointer

 Using CPUTYPE= and -march= seems a bit redundant. :)

 Not with NO_CPU_CFLAGS=yes and NO_CPU_COPTFLAGS=yes (if you want to
 use -march=native, that's the best thing to do).


 clang -c -O2 -pipe -march=native -fomit-frame-pointer -DIN_GCC
 -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -DHAVE_GTHR_DEFAULT
 -I/usr/src/gnu/lib/libgcc/../../../contrib/gcclibs/include
 -I/usr/src/gnu/lib/libgcc/../../../contrib/gcc/config
 -I/usr/src/gnu/lib/libgcc/../../../contrib/gcc -I.
 -I/usr/src/gnu/lib/libgcc/../../usr.bin/cc/cc_tools -std=gnu99
 -fvisibility=hidden -DHIDE_EXPORTS -fPIC -fexceptions -D__GLIBC__=3
 -DElfW=__ElfN -o unwind-dw2.o
 /usr/src/gnu/lib/libgcc/../../../contrib/gcc/unwind-dw2.c
 Assertion failed: (!spillIs.empty()  No spill intervals?),
 function assignRegOrStackSlotAtInterval, file

 /usr/src/lib/clang/libllvmcodegen/../../../contrib/llvm/lib/CodeGen/RegAllocLinearScan.cpp,
 line 1287.

 I haven't yet seen this one before.  If I can reproduce it, I will
 report it upstream, and see if they can come up with a fix.

 Anything I can provide to help with that ?


 Thanks !

 --
 Olivier Smedts

 --
 Olivier Smedts

-- 
Olivier Smedts                                                 _
                                        ASCII ribbon campaign ( )
e-mail: oliv...@gid0.org        - against HTML email  vCards  X
www: 

Re: Clang now builds world and kernel, on i386 and amd64

2010-09-28 Thread Olivier Smedts
2010/9/27 Olivier Smedts oliv...@gid0.org:
 2010/9/23 Bartosz Stec ad...@kkip.pl:
  On 2010-09-23 08:51, Roman Divacky wrote:

 if you want to post any build-time numbers for clang please

           -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS #-DNDEBUG

 uncomment the -DNDEBUG on this line in lib/clang/clang.build.mk
 and rebuild it otherwise you are using Release+Asserts build of
 clang which is some 30% slower than the normal one...
 ___
 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

 When i try to rebuild world again (machine has world and kernel builded with
 clang) I cought following problem at the very beginning:

 --
 World build started on Thu Sep 23 12:46:55 CEST 2010
 --

 --
 Rebuilding the temporary build tree
 --
 rm -rf /usr/obj/usr/src/tmp
 mkdir -p /usr/obj/usr/src/tmp/lib
 mkdir -p /usr/obj/usr/src/tmp/usr
 mkdir -p /usr/obj/usr/src/tmp/legacy/usr
 mtree -deU -f /usr/src/etc/mtree/BSD.usr.dist  -p
 /usr/obj/usr/src/tmp/legacy/usr /dev/null
 mtree -deU -f /usr/src/etc/mtree/BSD.usr.dist  -p /usr/obj/usr/src/tmp/usr
/dev/null
 mtree -deU -f /usr/src/etc/mtree/BSD.include.dist  -p
 /usr/obj/usr/src/tmp/usr/include /dev/null
 ln -sf /usr/src/sys /usr/obj/usr/src/tmp

 --
 stage 1.1: legacy release compatibility shims
 --
 cd /usr/src; MAKEOBJDIRPREFIX=/usr/obj/usr/src/tmp  INSTALL=sh
 /usr/src/tools/install.sh
  PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/sbin:/bin:/usr/sbin:/usr/bin
  WORLDTMP=/usr/obj/usr/src/tmp  VERSION=FreeBSD 9.0-CURRENT i386 900021
  MAKEFLAGS=-m /usr/src/tools/build/mk  -m /usr/src/share/mk make -f
 Makefile.inc1  DESTDIR=  BOOTSTRAPPING=900021  SSP_CFLAGS=  -DWITHOUT_HTML
 -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN  -DNO_PIC -DWITHOUT_PROFILE
 -DNO_SHARED  -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF legacy
 === tools/build (obj,includes,depend,all,install)
 /usr/obj/usr/src/tmp/usr/src/tools/build created for /usr/src/tools/build
 cd /usr/src/tools/build; make buildincludes; make installincludes
 rm -f .depend
 CC='clang' mkdep -f .depend -a    -I/usr/obj/usr/src/tmp/legacy/usr/include
 /usr/src/tools/build/dummy.c
 clang -O2 -pipe -std=gnu99   -I/usr/obj/usr/src/tmp/legacy/usr/include -c
 /usr/src/tools/build/dummy.c
 building static egacy library
 ranlib libegacy.a
 sh /usr/src/tools/install.sh -C -o root -g wheel -m 444   libegacy.a
 /usr/obj/usr/src/tmp/legacy/usr/lib

 --
 stage 1.2: bootstrap tools
 --
 cd /usr/src; MAKEOBJDIRPREFIX=/usr/obj/usr/src/tmp  INSTALL=sh
 /usr/src/tools/install.sh
  PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/sbin:/bin:/usr/sbin:/usr/bin
  WORLDTMP=/usr/obj/usr/src/tmp  VERSION=FreeBSD 9.0-CURRENT i386 900021
  MAKEFLAGS=-m /usr/src/tools/build/mk  -m /usr/src/share/mk make -f
 Makefile.inc1  DESTDIR=  BOOTSTRAPPING=900021  SSP_CFLAGS=  -DWITHOUT_HTML
 -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN  -DNO_PIC -DWITHOUT_PROFILE
 -DNO_SHARED  -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF bootstrap-tools
 === lib/clang/libllvmsupport (obj,depend,all,install)
 /usr/obj/usr/src/tmp/usr/src/lib/clang/libllvmsupport created for
 /usr/src/lib/clang/libllvmsupport
 rm -f .depend
 CC='clang' mkdep -f .depend -a
  -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/include
 -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/tools/clang/include
 -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support -I.
 -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/../../lib/clang/include
 -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD -D__STDC_LIMIT_MACROS
 -D__STDC_CONSTANT_MACROS -DNDEBUG
 -DLLVM_HOSTTRIPLE=\i386-undermydesk-freebsd9.0\
 -I/usr/obj/usr/src/tmp/legacy/usr/include
 /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/regcomp.c
 /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/regerror.c
 /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/regexec.c
 /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/regfree.c
 /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/regstrlcpy.c
 CC='clang' mkdep -f .depend -a
  -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/include
 -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/tools/clang/include
 

Re: Clang now builds world and kernel, on i386 and amd64

2010-09-28 Thread Renato Botelho
On Wed, Sep 22, 2010 at 3:42 AM, Dimitry Andric d...@freebsd.org wrote:
 Hi,

 As of r212979, you should now be able to build world and kernel on i386
 and amd64 with clang, without any additional patches!

 To do so, make sure you have updated your installed world to at least
 r212904 (which has the most recently imported clang/llvm snapshot), and
 put the following in /etc/src.conf:

 .if !defined(CC) || ${CC} == cc
 CC=clang
 .endif
 .if !defined(CXX) || ${CXX} == c++
 CXX=clang++
 .endif
 # Don't die on warnings
 NO_WERROR=
 WERROR=

 Both world and kernel can also be installed, and should run properly,
 but please make sure you have a way to revert if anything unexpected
 happens. :)  Alternatively, just install into a chroot to try it out
 from there.

 Some additional information can be found on this wiki page:

 http://wiki.freebsd.org/BuildingFreeBSDWithClang

 Thanks to all the people that made this possible, especially Roman
 Divacky, Ed Schouten, Rui Paulo, and of course the clang/llvm
 developers.

I built my desktop world + kernel with clang, rev. 213247 amd64, it
booted perfectly, the only problem i got was something went wrong
with a perl module File::Temp.

To be sure it's related i'm rebuilding the src (same rev.) with gcc and
will take a look if it will back to work. I'll send an email after testing.

Just to show, the problem i got with perl was using this code:

#!/usr/bin/perl

use File::Temp;

my ( $fh, $filename ) = File::Temp::tempfile();
print $filename\n;
unlink $filename;

with this results:

Error in tempfile() using /tmp/XX: Tried to get a new temp
name different to the previous value 50 times.
Something wrong with template?? (/tmp/XX) at testes/tmp.pl line 5

Regards
-- 
Renato Botelho
___
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 now builds world and kernel, on i386 and amd64

2010-09-28 Thread Renato Botelho
On Tue, Sep 28, 2010 at 6:07 PM, Renato Botelho rbga...@gmail.com wrote:
 On Wed, Sep 22, 2010 at 3:42 AM, Dimitry Andric d...@freebsd.org wrote:
 Hi,

 As of r212979, you should now be able to build world and kernel on i386
 and amd64 with clang, without any additional patches!

 To do so, make sure you have updated your installed world to at least
 r212904 (which has the most recently imported clang/llvm snapshot), and
 put the following in /etc/src.conf:

 .if !defined(CC) || ${CC} == cc
 CC=clang
 .endif
 .if !defined(CXX) || ${CXX} == c++
 CXX=clang++
 .endif
 # Don't die on warnings
 NO_WERROR=
 WERROR=

 Both world and kernel can also be installed, and should run properly,
 but please make sure you have a way to revert if anything unexpected
 happens. :)  Alternatively, just install into a chroot to try it out
 from there.

 Some additional information can be found on this wiki page:

 http://wiki.freebsd.org/BuildingFreeBSDWithClang

 Thanks to all the people that made this possible, especially Roman
 Divacky, Ed Schouten, Rui Paulo, and of course the clang/llvm
 developers.

 I built my desktop world + kernel with clang, rev. 213247 amd64, it
 booted perfectly, the only problem i got was something went wrong
 with a perl module File::Temp.

 To be sure it's related i'm rebuilding the src (same rev.) with gcc and
 will take a look if it will back to work. I'll send an email after testing.

 Just to show, the problem i got with perl was using this code:

 #!/usr/bin/perl

 use File::Temp;

 my ( $fh, $filename ) = File::Temp::tempfile();
 print $filename\n;
 unlink $filename;

 with this results:

 Error in tempfile() using /tmp/XX: Tried to get a new temp
 name different to the previous value 50 times.
 Something wrong with template?? (/tmp/XX) at testes/tmp.pl line 5

After rebuild world+kernel with gcc and reboot everything
back to normal:

ga...@botelhor:~ perl testes/tmp.pl
/tmp/MfmvMiztew
ga...@botelhor:~ perl testes/tmp.pl
/tmp/M4xIxsTxlc

I'm using perl-5.12.2_2

-- 
Renato Botelho
___
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 now builds world and kernel, on i386 and amd64

2010-09-28 Thread Renato Botelho
On Tue, Sep 28, 2010 at 9:28 PM, Derek Tattersall d...@mebtel.net wrote:
 * Renato Botelho rbga...@gmail.com [100928 20:20]:
 On Tue, Sep 28, 2010 at 6:07 PM, Renato Botelho rbga...@gmail.com wrote:
  On Wed, Sep 22, 2010 at 3:42 AM, Dimitry Andric d...@freebsd.org wrote:
  Hi,
 
  As of r212979, you should now be able to build world and kernel on i386
  and amd64 with clang, without any additional patches!
 
  To do so, make sure you have updated your installed world to at least
  r212904 (which has the most recently imported clang/llvm snapshot), and
  put the following in /etc/src.conf:
 
  .if !defined(CC) || ${CC} == cc
  CC=clang
  .endif
  .if !defined(CXX) || ${CXX} == c++
  CXX=clang++
  .endif
  # Don't die on warnings
  NO_WERROR=
  WERROR=
 
  Both world and kernel can also be installed, and should run properly,
  but please make sure you have a way to revert if anything unexpected
  happens. :) ?Alternatively, just install into a chroot to try it out
  from there.
 
  Some additional information can be found on this wiki page:
 
  http://wiki.freebsd.org/BuildingFreeBSDWithClang
 
  Thanks to all the people that made this possible, especially Roman
  Divacky, Ed Schouten, Rui Paulo, and of course the clang/llvm
  developers.
 
  I built my desktop world + kernel with clang, rev. 213247 amd64, it
  booted perfectly, the only problem i got was something went wrong
  with a perl module File::Temp.
 
  To be sure it's related i'm rebuilding the src (same rev.) with gcc and
  will take a look if it will back to work. I'll send an email after testing.
 
  Just to show, the problem i got with perl was using this code:
 
  #!/usr/bin/perl
 
  use File::Temp;
 
  my ( $fh, $filename ) = File::Temp::tempfile();
  print $filename\n;
  unlink $filename;
 
  with this results:
 
  Error in tempfile() using /tmp/XX: Tried to get a new temp
  name different to the previous value 50 times.
  Something wrong with template?? (/tmp/XX) at testes/tmp.pl line 5

 After rebuild world+kernel with gcc and reboot everything
 back to normal:

 ga...@botelhor:~ perl testes/tmp.pl
 /tmp/MfmvMiztew
 ga...@botelhor:~ perl testes/tmp.pl
 /tmp/M4xIxsTxlc

 I'm using perl-5.12.2_2

 --
 Renato Botelho
 ___
 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
 A test shell script using mktemp (1) works fine on current built with
 clang today.  The clang case produces a filename with all A's rather
 than the random letters expected.

I didn't test mktemp, but my perl test code generate files
with all 'A' just after i reboot the machine with clang, after
few minutes it stop working and give the error I reported.

Please let me know if there is any kind of information I
can send to help fixing this.

-- 
Renato Botelho
___
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 now builds world and kernel, on i386 and amd64

2010-09-28 Thread Derek Tattersall
* Renato Botelho rbga...@gmail.com [100928 20:20]:
 On Tue, Sep 28, 2010 at 6:07 PM, Renato Botelho rbga...@gmail.com wrote:
  On Wed, Sep 22, 2010 at 3:42 AM, Dimitry Andric d...@freebsd.org wrote:
  Hi,
 
  As of r212979, you should now be able to build world and kernel on i386
  and amd64 with clang, without any additional patches!
 
  To do so, make sure you have updated your installed world to at least
  r212904 (which has the most recently imported clang/llvm snapshot), and
  put the following in /etc/src.conf:
 
  .if !defined(CC) || ${CC} == cc
  CC=clang
  .endif
  .if !defined(CXX) || ${CXX} == c++
  CXX=clang++
  .endif
  # Don't die on warnings
  NO_WERROR=
  WERROR=
 
  Both world and kernel can also be installed, and should run properly,
  but please make sure you have a way to revert if anything unexpected
  happens. :) ?Alternatively, just install into a chroot to try it out
  from there.
 
  Some additional information can be found on this wiki page:
 
  http://wiki.freebsd.org/BuildingFreeBSDWithClang
 
  Thanks to all the people that made this possible, especially Roman
  Divacky, Ed Schouten, Rui Paulo, and of course the clang/llvm
  developers.
 
  I built my desktop world + kernel with clang, rev. 213247 amd64, it
  booted perfectly, the only problem i got was something went wrong
  with a perl module File::Temp.
 
  To be sure it's related i'm rebuilding the src (same rev.) with gcc and
  will take a look if it will back to work. I'll send an email after testing.
 
  Just to show, the problem i got with perl was using this code:
 
  #!/usr/bin/perl
 
  use File::Temp;
 
  my ( $fh, $filename ) = File::Temp::tempfile();
  print $filename\n;
  unlink $filename;
 
  with this results:
 
  Error in tempfile() using /tmp/XX: Tried to get a new temp
  name different to the previous value 50 times.
  Something wrong with template?? (/tmp/XX) at testes/tmp.pl line 5
 
 After rebuild world+kernel with gcc and reboot everything
 back to normal:
 
 ga...@botelhor:~ perl testes/tmp.pl
 /tmp/MfmvMiztew
 ga...@botelhor:~ perl testes/tmp.pl
 /tmp/M4xIxsTxlc
 
 I'm using perl-5.12.2_2
 
 -- 
 Renato Botelho
 ___
 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
A test shell script using mktemp (1) works fine on current built with
clang today.  The clang case produces a filename with all A's rather
than the random letters expected. 
-- 
Best regards,
Derek Tattersall
d...@mebtel.net dlt...@yahoo.com dtatt...@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 now builds world and kernel, on i386 and amd64

2010-09-27 Thread Olivier Smedts
2010/9/27 Olivier Smedts oliv...@gid0.org:
 2010/9/23 Bartosz Stec ad...@kkip.pl:
  On 2010-09-23 08:51, Roman Divacky wrote:

 if you want to post any build-time numbers for clang please

           -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS #-DNDEBUG

 uncomment the -DNDEBUG on this line in lib/clang/clang.build.mk
 and rebuild it otherwise you are using Release+Asserts build of
 clang which is some 30% slower than the normal one...
 ___
 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

 When i try to rebuild world again (machine has world and kernel builded with
 clang) I cought following problem at the very beginning:

 --
 World build started on Thu Sep 23 12:46:55 CEST 2010
 --

 --
 Rebuilding the temporary build tree
 --
 rm -rf /usr/obj/usr/src/tmp
 mkdir -p /usr/obj/usr/src/tmp/lib
 mkdir -p /usr/obj/usr/src/tmp/usr
 mkdir -p /usr/obj/usr/src/tmp/legacy/usr
 mtree -deU -f /usr/src/etc/mtree/BSD.usr.dist  -p
 /usr/obj/usr/src/tmp/legacy/usr /dev/null
 mtree -deU -f /usr/src/etc/mtree/BSD.usr.dist  -p /usr/obj/usr/src/tmp/usr
/dev/null
 mtree -deU -f /usr/src/etc/mtree/BSD.include.dist  -p
 /usr/obj/usr/src/tmp/usr/include /dev/null
 ln -sf /usr/src/sys /usr/obj/usr/src/tmp

 --
 stage 1.1: legacy release compatibility shims
 --
 cd /usr/src; MAKEOBJDIRPREFIX=/usr/obj/usr/src/tmp  INSTALL=sh
 /usr/src/tools/install.sh
  PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/sbin:/bin:/usr/sbin:/usr/bin
  WORLDTMP=/usr/obj/usr/src/tmp  VERSION=FreeBSD 9.0-CURRENT i386 900021
  MAKEFLAGS=-m /usr/src/tools/build/mk  -m /usr/src/share/mk make -f
 Makefile.inc1  DESTDIR=  BOOTSTRAPPING=900021  SSP_CFLAGS=  -DWITHOUT_HTML
 -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN  -DNO_PIC -DWITHOUT_PROFILE
 -DNO_SHARED  -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF legacy
 === tools/build (obj,includes,depend,all,install)
 /usr/obj/usr/src/tmp/usr/src/tools/build created for /usr/src/tools/build
 cd /usr/src/tools/build; make buildincludes; make installincludes
 rm -f .depend
 CC='clang' mkdep -f .depend -a    -I/usr/obj/usr/src/tmp/legacy/usr/include
 /usr/src/tools/build/dummy.c
 clang -O2 -pipe -std=gnu99   -I/usr/obj/usr/src/tmp/legacy/usr/include -c
 /usr/src/tools/build/dummy.c
 building static egacy library
 ranlib libegacy.a
 sh /usr/src/tools/install.sh -C -o root -g wheel -m 444   libegacy.a
 /usr/obj/usr/src/tmp/legacy/usr/lib

 --
 stage 1.2: bootstrap tools
 --
 cd /usr/src; MAKEOBJDIRPREFIX=/usr/obj/usr/src/tmp  INSTALL=sh
 /usr/src/tools/install.sh
  PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/sbin:/bin:/usr/sbin:/usr/bin
  WORLDTMP=/usr/obj/usr/src/tmp  VERSION=FreeBSD 9.0-CURRENT i386 900021
  MAKEFLAGS=-m /usr/src/tools/build/mk  -m /usr/src/share/mk make -f
 Makefile.inc1  DESTDIR=  BOOTSTRAPPING=900021  SSP_CFLAGS=  -DWITHOUT_HTML
 -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN  -DNO_PIC -DWITHOUT_PROFILE
 -DNO_SHARED  -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF bootstrap-tools
 === lib/clang/libllvmsupport (obj,depend,all,install)
 /usr/obj/usr/src/tmp/usr/src/lib/clang/libllvmsupport created for
 /usr/src/lib/clang/libllvmsupport
 rm -f .depend
 CC='clang' mkdep -f .depend -a
  -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/include
 -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/tools/clang/include
 -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support -I.
 -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/../../lib/clang/include
 -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD -D__STDC_LIMIT_MACROS
 -D__STDC_CONSTANT_MACROS -DNDEBUG
 -DLLVM_HOSTTRIPLE=\i386-undermydesk-freebsd9.0\
 -I/usr/obj/usr/src/tmp/legacy/usr/include
 /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/regcomp.c
 /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/regerror.c
 /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/regexec.c
 /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/regfree.c
 /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/regstrlcpy.c
 CC='clang' mkdep -f .depend -a
  -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/include
 -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/tools/clang/include
 

Re: Clang now builds world and kernel, on i386 and amd64

2010-09-27 Thread Olivier Smedts
2010/9/23 Bartosz Stec ad...@kkip.pl:
  On 2010-09-23 08:51, Roman Divacky wrote:

 if you want to post any build-time numbers for clang please

           -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS #-DNDEBUG

 uncomment the -DNDEBUG on this line in lib/clang/clang.build.mk
 and rebuild it otherwise you are using Release+Asserts build of
 clang which is some 30% slower than the normal one...
 ___
 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

 When i try to rebuild world again (machine has world and kernel builded with
 clang) I cought following problem at the very beginning:

 --
 World build started on Thu Sep 23 12:46:55 CEST 2010
 --

 --
 Rebuilding the temporary build tree
 --
 rm -rf /usr/obj/usr/src/tmp
 mkdir -p /usr/obj/usr/src/tmp/lib
 mkdir -p /usr/obj/usr/src/tmp/usr
 mkdir -p /usr/obj/usr/src/tmp/legacy/usr
 mtree -deU -f /usr/src/etc/mtree/BSD.usr.dist  -p
 /usr/obj/usr/src/tmp/legacy/usr /dev/null
 mtree -deU -f /usr/src/etc/mtree/BSD.usr.dist  -p /usr/obj/usr/src/tmp/usr
/dev/null
 mtree -deU -f /usr/src/etc/mtree/BSD.include.dist  -p
 /usr/obj/usr/src/tmp/usr/include /dev/null
 ln -sf /usr/src/sys /usr/obj/usr/src/tmp

 --
 stage 1.1: legacy release compatibility shims
 --
 cd /usr/src; MAKEOBJDIRPREFIX=/usr/obj/usr/src/tmp  INSTALL=sh
 /usr/src/tools/install.sh
  PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/sbin:/bin:/usr/sbin:/usr/bin
  WORLDTMP=/usr/obj/usr/src/tmp  VERSION=FreeBSD 9.0-CURRENT i386 900021
  MAKEFLAGS=-m /usr/src/tools/build/mk  -m /usr/src/share/mk make -f
 Makefile.inc1  DESTDIR=  BOOTSTRAPPING=900021  SSP_CFLAGS=  -DWITHOUT_HTML
 -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN  -DNO_PIC -DWITHOUT_PROFILE
 -DNO_SHARED  -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF legacy
 === tools/build (obj,includes,depend,all,install)
 /usr/obj/usr/src/tmp/usr/src/tools/build created for /usr/src/tools/build
 cd /usr/src/tools/build; make buildincludes; make installincludes
 rm -f .depend
 CC='clang' mkdep -f .depend -a    -I/usr/obj/usr/src/tmp/legacy/usr/include
 /usr/src/tools/build/dummy.c
 clang -O2 -pipe -std=gnu99   -I/usr/obj/usr/src/tmp/legacy/usr/include -c
 /usr/src/tools/build/dummy.c
 building static egacy library
 ranlib libegacy.a
 sh /usr/src/tools/install.sh -C -o root -g wheel -m 444   libegacy.a
 /usr/obj/usr/src/tmp/legacy/usr/lib

 --
 stage 1.2: bootstrap tools
 --
 cd /usr/src; MAKEOBJDIRPREFIX=/usr/obj/usr/src/tmp  INSTALL=sh
 /usr/src/tools/install.sh
  PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/sbin:/bin:/usr/sbin:/usr/bin
  WORLDTMP=/usr/obj/usr/src/tmp  VERSION=FreeBSD 9.0-CURRENT i386 900021
  MAKEFLAGS=-m /usr/src/tools/build/mk  -m /usr/src/share/mk make -f
 Makefile.inc1  DESTDIR=  BOOTSTRAPPING=900021  SSP_CFLAGS=  -DWITHOUT_HTML
 -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN  -DNO_PIC -DWITHOUT_PROFILE
 -DNO_SHARED  -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF bootstrap-tools
 === lib/clang/libllvmsupport (obj,depend,all,install)
 /usr/obj/usr/src/tmp/usr/src/lib/clang/libllvmsupport created for
 /usr/src/lib/clang/libllvmsupport
 rm -f .depend
 CC='clang' mkdep -f .depend -a
  -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/include
 -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/tools/clang/include
 -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support -I.
 -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/../../lib/clang/include
 -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD -D__STDC_LIMIT_MACROS
 -D__STDC_CONSTANT_MACROS -DNDEBUG
 -DLLVM_HOSTTRIPLE=\i386-undermydesk-freebsd9.0\
 -I/usr/obj/usr/src/tmp/legacy/usr/include
 /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/regcomp.c
 /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/regerror.c
 /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/regexec.c
 /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/regfree.c
 /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/regstrlcpy.c
 CC='clang' mkdep -f .depend -a
  -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/include
 -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/tools/clang/include
 -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support -I.

Re: Clang now builds world and kernel, on i386 and amd64

2010-09-27 Thread Dimitry Andric

On 2010-09-27 09:32, Olivier Smedts wrote:

2010/9/23 Bartosz Stecad...@kkip.pl:

...

Assertion failed: (false  Ran out of registers during register
allocation!), function assignRegOrStackSlotAtInterval, file
/usr/src/lib/clang/libllvmcodegen/../../../contrib/llvm/lib/CodeGen/RegAllocLinearScan.cpp,
line 1196.

...

Same error here with yesterday's -CURRENT, but not at the same time
(the running system was compiled using gcc) :


As with Bartosz, could you please remove the CPU-specific flags from
make.conf, and try again?

I guess there is something borked in LLVM's Athlon optimization, so it
is probably better to not try to tickly those bugs for now.




# grep -vE '^#|^$' /etc/make.conf
KERNCONF=XPC
CPUTYPE=athlon-xp
CFLAGS=-O2 -pipe -march=native -fomit-frame-pointer


Using CPUTYPE= and -march= seems a bit redundant. :)



clang -c -O2 -pipe -march=native -fomit-frame-pointer -DIN_GCC
-DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -DHAVE_GTHR_DEFAULT
-I/usr/src/gnu/lib/libgcc/../../../contrib/gcclibs/include
-I/usr/src/gnu/lib/libgcc/../../../contrib/gcc/config
-I/usr/src/gnu/lib/libgcc/../../../contrib/gcc -I.
-I/usr/src/gnu/lib/libgcc/../../usr.bin/cc/cc_tools -std=gnu99
-fvisibility=hidden -DHIDE_EXPORTS -fPIC -fexceptions -D__GLIBC__=3
-DElfW=__ElfN -o unwind-dw2.o
/usr/src/gnu/lib/libgcc/../../../contrib/gcc/unwind-dw2.c
Assertion failed: (!spillIs.empty()  No spill intervals?),
function assignRegOrStackSlotAtInterval, file
/usr/src/lib/clang/libllvmcodegen/../../../contrib/llvm/lib/CodeGen/RegAllocLinearScan.cpp,
line 1287.


I haven't yet seen this one before.  If I can reproduce it, I will
report it upstream, and see if they can come up with a fix.
___
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 now builds world and kernel, on i386 and amd64

2010-09-27 Thread Olivier Smedts
2010/9/27 Dimitry Andric d...@freebsd.org:
 On 2010-09-27 09:32, Olivier Smedts wrote:

 2010/9/23 Bartosz Stecad...@kkip.pl:

 ...

 Assertion failed: (false  Ran out of registers during register
 allocation!), function assignRegOrStackSlotAtInterval, file

 /usr/src/lib/clang/libllvmcodegen/../../../contrib/llvm/lib/CodeGen/RegAllocLinearScan.cpp,
 line 1196.

 ...

 Same error here with yesterday's -CURRENT, but not at the same time
 (the running system was compiled using gcc) :

 As with Bartosz, could you please remove the CPU-specific flags from
 make.conf, and try again?

Ok, I'll post the results later (it was the same with -DNDEBUG).

 I guess there is something borked in LLVM's Athlon optimization, so it
 is probably better to not try to tickly those bugs for now.



 # grep -vE '^#|^$' /etc/make.conf
 KERNCONF=XPC
 CPUTYPE=athlon-xp
 CFLAGS=-O2 -pipe -march=native -fomit-frame-pointer

 Using CPUTYPE= and -march= seems a bit redundant. :)

Not with NO_CPU_CFLAGS=yes and NO_CPU_COPTFLAGS=yes (if you want to
use -march=native, that's the best thing to do).


 clang -c -O2 -pipe -march=native -fomit-frame-pointer -DIN_GCC
 -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -DHAVE_GTHR_DEFAULT
 -I/usr/src/gnu/lib/libgcc/../../../contrib/gcclibs/include
 -I/usr/src/gnu/lib/libgcc/../../../contrib/gcc/config
 -I/usr/src/gnu/lib/libgcc/../../../contrib/gcc -I.
 -I/usr/src/gnu/lib/libgcc/../../usr.bin/cc/cc_tools -std=gnu99
 -fvisibility=hidden -DHIDE_EXPORTS -fPIC -fexceptions -D__GLIBC__=3
 -DElfW=__ElfN -o unwind-dw2.o
 /usr/src/gnu/lib/libgcc/../../../contrib/gcc/unwind-dw2.c
 Assertion failed: (!spillIs.empty()  No spill intervals?),
 function assignRegOrStackSlotAtInterval, file

 /usr/src/lib/clang/libllvmcodegen/../../../contrib/llvm/lib/CodeGen/RegAllocLinearScan.cpp,
 line 1287.

 I haven't yet seen this one before.  If I can reproduce it, I will
 report it upstream, and see if they can come up with a fix.


Thanks !

-- 
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 now builds world and kernel, on i386 and amd64

2010-09-27 Thread Olivier Smedts
2010/9/27 Olivier Smedts oliv...@gid0.org:
 2010/9/27 Dimitry Andric d...@freebsd.org:
 On 2010-09-27 09:32, Olivier Smedts wrote:

 2010/9/23 Bartosz Stecad...@kkip.pl:

 ...

 Assertion failed: (false  Ran out of registers during register
 allocation!), function assignRegOrStackSlotAtInterval, file

 /usr/src/lib/clang/libllvmcodegen/../../../contrib/llvm/lib/CodeGen/RegAllocLinearScan.cpp,
 line 1196.

 ...

 Same error here with yesterday's -CURRENT, but not at the same time
 (the running system was compiled using gcc) :

 As with Bartosz, could you please remove the CPU-specific flags from
 make.conf, and try again?

 Ok, I'll post the results later (it was the same with -DNDEBUG).

Was not OK with :
CPUTYPE=athlon-xp
CFLAGS=-O2 -pipe -march=native -fomit-frame-pointer
NO_CPU_CFLAGS=yes
COPTFLAGS=-O2 -pipe -march=native -fomit-frame-pointer
NO_CPU_COPTFLAGS=yes

Is OK with :
CPUTYPE=athlon-xp
CFLAGS=-O2 -pipe -fomit-frame-pointer
NO_CPU_CFLAGS=yes
COPTFLAGS=-O2 -pipe -fomit-frame-pointer
NO_CPU_COPTFLAGS=yes

I'll try with other -march (i686 and athlon) and post results.

 I guess there is something borked in LLVM's Athlon optimization, so it
 is probably better to not try to tickly those bugs for now.



 # grep -vE '^#|^$' /etc/make.conf
 KERNCONF=XPC
 CPUTYPE=athlon-xp
 CFLAGS=-O2 -pipe -march=native -fomit-frame-pointer

 Using CPUTYPE= and -march= seems a bit redundant. :)

 Not with NO_CPU_CFLAGS=yes and NO_CPU_COPTFLAGS=yes (if you want to
 use -march=native, that's the best thing to do).


 clang -c -O2 -pipe -march=native -fomit-frame-pointer -DIN_GCC
 -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -DHAVE_GTHR_DEFAULT
 -I/usr/src/gnu/lib/libgcc/../../../contrib/gcclibs/include
 -I/usr/src/gnu/lib/libgcc/../../../contrib/gcc/config
 -I/usr/src/gnu/lib/libgcc/../../../contrib/gcc -I.
 -I/usr/src/gnu/lib/libgcc/../../usr.bin/cc/cc_tools -std=gnu99
 -fvisibility=hidden -DHIDE_EXPORTS -fPIC -fexceptions -D__GLIBC__=3
 -DElfW=__ElfN -o unwind-dw2.o
 /usr/src/gnu/lib/libgcc/../../../contrib/gcc/unwind-dw2.c
 Assertion failed: (!spillIs.empty()  No spill intervals?),
 function assignRegOrStackSlotAtInterval, file

 /usr/src/lib/clang/libllvmcodegen/../../../contrib/llvm/lib/CodeGen/RegAllocLinearScan.cpp,
 line 1287.

 I haven't yet seen this one before.  If I can reproduce it, I will
 report it upstream, and see if they can come up with a fix.

Anything I can provide to help with that ?


 Thanks !

 --
 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.




-- 
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 now builds world and kernel, on i386 and amd64

2010-09-26 Thread Roman Divacky
On Sat, Sep 25, 2010 at 08:55:51PM +, b. f. wrote:
 Dmitry Andric wrote:
 On 2010-09-25 21:16, Paul B Mahol wrote:
  When to expect to get rid of GNU as and other binutils tools?
 
 Work is progressing steadily on the clang/llvm integrated assembler,
 which removes the need for an external assembler such as gas, and which
 should also reduce compile times further.  This is really in alpha state
 right now, but Roman Divacky (who is one of the active contributors) can
 probably tell more about its progress.
 
 Another important component is of course the linker, but I am not aware
 of a similar project to replace that; excepting gold, but that is a
 GPLv3 project too, unfortunately.
 
 There has been another effort underway for some time:
 
 http://sourceforge.net/apps/trac/elftoolchain/
 
 Perhaps some coordination between those working on llvm in FreeBSD,
 and the elftoolchain project, would be helpful?

there's not that much overlap between those two - in a case elftoolchain
gets to implementing linker it would be sweet if it supported the same
plugin API as gold so we can use LLVM LTO plugin there...

beside that I dont see much point in teaching nm to see into llvm object
files etc. (we already have tools for that)
___
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 now builds world and kernel, on i386 and amd64

2010-09-26 Thread Bartosz Stec

 W dniu 2010-09-24 16:34, Dimitry Andric pisze:

On 2010-09-24 14:13, Bartosz Stec wrote:
Could you please try to rename this make.conf to e.g. 
make.conf.disable,

and retry the world build?

Still the same without make.conf. My personal guess is, that clang
builded by clang with CPUTYPE=athlon-xp is somehow broken. I don't think
CFLAGS=-O2 -pipe could do any harm, and also note that clang builded by
GCC with exactly the same make.conf has no problems with world 
building :)


I still cannot reproduce your issue...  To check, I have built world
with CPUTYPE=athlon-xp, verified it used -O2 -pipe -march=athlon-xp as
compilation flags for the world stage, and installed the resulting clang
executables.

Those clang executables do not exhibit the same problem as yours do;
they can build tblgen (during the bootstrap-tools stage) fine.

I suggest you comment out the CPUTYPE macro in make.conf for now,
rebuild your world with gcc, and then rebuild it with clang again, to
see if the issue goes away.


Indeed, I was right. Problem is gone after hashing out CPUTYPE line, 
building world with GCC, and with clang after that. Now world is 
building without problems.


But hey, i just realized that:

   # dmesg | grep -i cpu
   CPU: mobile AMD Athlon(tm) XP 2200+ (1800.11-MHz 686-class CPU)

I simply forgot that about a year ago I changed Athlon XP in this BOX to 
Athlon MP and I didn't changed CPUTYPE in make.conf...
So maybe clang in fact did exactly what it should and created binary 
designed to other CPUTYPE ;) I don't know exact differences between 
Athlon XP/MP architecture (registers specially) but I just started 
another try with CPUTYPE=Athlon-mp and I will post results :)


--
Bartosz Stec



--
IT4Pro Bartosz Stec
http://www.it4pro.pl
tel: 607041002
E-Mail: bartosz.s...@it4pro.pl

___
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 now builds world and kernel, on i386 and amd64

2010-09-26 Thread Bartosz Stec

 W dniu 2010-09-26 14:42, Erik Trulsson pisze:

On Sun, Sep 26, 2010 at 02:21:51PM +0200, Bartosz Stec wrote:

   W dniu 2010-09-24 16:34, Dimitry Andric pisze:

On 2010-09-24 14:13, Bartosz Stec wrote:

Could you please try to rename this make.conf to e.g.
make.conf.disable,
and retry the world build?

Still the same without make.conf. My personal guess is, that clang
builded by clang with CPUTYPE=athlon-xp is somehow broken. I don't think
CFLAGS=-O2 -pipe could do any harm, and also note that clang builded by
GCC with exactly the same make.conf has no problems with world
building :)

I still cannot reproduce your issue...  To check, I have built world
with CPUTYPE=athlon-xp, verified it used -O2 -pipe -march=athlon-xp as
compilation flags for the world stage, and installed the resulting clang
executables.

Those clang executables do not exhibit the same problem as yours do;
they can build tblgen (during the bootstrap-tools stage) fine.

I suggest you comment out the CPUTYPE macro in make.conf for now,
rebuild your world with gcc, and then rebuild it with clang again, to
see if the issue goes away.

Indeed, I was right. Problem is gone after hashing out CPUTYPE line,
building world with GCC, and with clang after that. Now world is
building without problems.

But hey, i just realized that:

 # dmesg | grep -i cpu
 CPU: mobile AMD Athlon(tm) XP 2200+ (1800.11-MHz 686-class CPU)

I simply forgot that about a year ago I changed Athlon XP in this BOX to
Athlon MP and I didn't changed CPUTYPE in make.conf...
So maybe clang in fact did exactly what it should and created binary
designed to other CPUTYPE ;) I don't know exact differences between
Athlon XP/MP architecture (registers specially) but I just started
another try with CPUTYPE=Athlon-mp and I will post results :)

The only difference between Athlon XP and Athlon MP is that the MP
variants are certified for multi-processor use (in reality most Athlon
XP also worked just fine in multi-processor systems, or could easily be
modified to do so.)  Available instructions and registers are identical
between the two.  Mobile variants of the Athlon XP should also be
identical from a programming point of view.



That's what I thought too, but in that case, why are they different 
optimisations available?

In /usr/share/examples/etc/make.conf:

   # Currently the following CPU types are recognized:
   #   Intel x86 architecture:
   #   (AMD CPUs)  opteron athlon64 athlon-mp athlon-xp athlon-4
   #   athlon-tbird athlon k8 k6-3 k6-2 k6 k5

Or maybe some of them are in fact bywords to compiler?

Still, my CURRENT box is at idle mostly, so I will experiment a little 
and see what I get.


Cheers

--
Bartosz Stec


___
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 now builds world and kernel, on i386 and amd64

2010-09-26 Thread Erik Trulsson
On Sun, Sep 26, 2010 at 02:21:51PM +0200, Bartosz Stec wrote:
   W dniu 2010-09-24 16:34, Dimitry Andric pisze:
  On 2010-09-24 14:13, Bartosz Stec wrote:
  Could you please try to rename this make.conf to e.g. 
  make.conf.disable,
  and retry the world build?
  Still the same without make.conf. My personal guess is, that clang
  builded by clang with CPUTYPE=athlon-xp is somehow broken. I don't think
  CFLAGS=-O2 -pipe could do any harm, and also note that clang builded by
  GCC with exactly the same make.conf has no problems with world 
  building :)
 
  I still cannot reproduce your issue...  To check, I have built world
  with CPUTYPE=athlon-xp, verified it used -O2 -pipe -march=athlon-xp as
  compilation flags for the world stage, and installed the resulting clang
  executables.
 
  Those clang executables do not exhibit the same problem as yours do;
  they can build tblgen (during the bootstrap-tools stage) fine.
 
  I suggest you comment out the CPUTYPE macro in make.conf for now,
  rebuild your world with gcc, and then rebuild it with clang again, to
  see if the issue goes away.
 
 Indeed, I was right. Problem is gone after hashing out CPUTYPE line, 
 building world with GCC, and with clang after that. Now world is 
 building without problems.
 
 But hey, i just realized that:
 
 # dmesg | grep -i cpu
 CPU: mobile AMD Athlon(tm) XP 2200+ (1800.11-MHz 686-class CPU)
 
 I simply forgot that about a year ago I changed Athlon XP in this BOX to 
 Athlon MP and I didn't changed CPUTYPE in make.conf...
 So maybe clang in fact did exactly what it should and created binary 
 designed to other CPUTYPE ;) I don't know exact differences between 
 Athlon XP/MP architecture (registers specially) but I just started 
 another try with CPUTYPE=Athlon-mp and I will post results :)

The only difference between Athlon XP and Athlon MP is that the MP
variants are certified for multi-processor use (in reality most Athlon
XP also worked just fine in multi-processor systems, or could easily be
modified to do so.)  Available instructions and registers are identical
between the two.  Mobile variants of the Athlon XP should also be
identical from a programming point of view.



-- 
Insert your favourite quote here.
Erik Trulsson
ertr1...@student.uu.se
___
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 now builds world and kernel, on i386 and amd64

2010-09-26 Thread Bartosz Stec

 W dniu 2010-09-26 14:54, Bartosz Stec pisze:

 W dniu 2010-09-26 14:42, Erik Trulsson pisze:

On Sun, Sep 26, 2010 at 02:21:51PM +0200, Bartosz Stec wrote:

   W dniu 2010-09-24 16:34, Dimitry Andric pisze:

On 2010-09-24 14:13, Bartosz Stec wrote:

Could you please try to rename this make.conf to e.g.
make.conf.disable,
and retry the world build?

Still the same without make.conf. My personal guess is, that clang
builded by clang with CPUTYPE=athlon-xp is somehow broken. I don't 
think
CFLAGS=-O2 -pipe could do any harm, and also note that clang 
builded by

GCC with exactly the same make.conf has no problems with world
building :)

I still cannot reproduce your issue...  To check, I have built world
with CPUTYPE=athlon-xp, verified it used -O2 -pipe 
-march=athlon-xp as
compilation flags for the world stage, and installed the resulting 
clang

executables.

Those clang executables do not exhibit the same problem as yours do;
they can build tblgen (during the bootstrap-tools stage) fine.

I suggest you comment out the CPUTYPE macro in make.conf for now,
rebuild your world with gcc, and then rebuild it with clang again, to
see if the issue goes away.

Indeed, I was right. Problem is gone after hashing out CPUTYPE line,
building world with GCC, and with clang after that. Now world is
building without problems.

But hey, i just realized that:

 # dmesg | grep -i cpu
 CPU: mobile AMD Athlon(tm) XP 2200+ (1800.11-MHz 686-class CPU)

I simply forgot that about a year ago I changed Athlon XP in this 
BOX to

Athlon MP and I didn't changed CPUTYPE in make.conf...
So maybe clang in fact did exactly what it should and created binary
designed to other CPUTYPE ;) I don't know exact differences between
Athlon XP/MP architecture (registers specially) but I just started
another try with CPUTYPE=Athlon-mp and I will post results :)

The only difference between Athlon XP and Athlon MP is that the MP
variants are certified for multi-processor use (in reality most Athlon
XP also worked just fine in multi-processor systems, or could easily be
modified to do so.)  Available instructions and registers are identical
between the two.  Mobile variants of the Athlon XP should also be
identical from a programming point of view.



That's what I thought too, but in that case, why are they different 
optimisations available?

In /usr/share/examples/etc/make.conf:

   # Currently the following CPU types are recognized:
   #   Intel x86 architecture:
   #   (AMD CPUs)  opteron athlon64 athlon-mp athlon-xp athlon-4
   #   athlon-tbird athlon k8 k6-3 k6-2 k6 k5

Or maybe some of them are in fact bywords to compiler?

Still, my CURRENT box is at idle mostly, so I will experiment a little 
and see what I get.


Cheers

Argh, I assumed that 'Mobile Athlon XP' == 'Athlon MP' while it seem's 
that they aren't. CPUTYPE=athlon-xp was a right choice for my CPU.

Sorry for mistake.

--
Bartosz Stec


___
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 now builds world and kernel, on i386 and amd64

2010-09-25 Thread Paul B Mahol
On 9/22/10, Dimitry Andric d...@freebsd.org wrote:
 Hi,

 As of r212979, you should now be able to build world and kernel on i386
 and amd64 with clang, without any additional patches!

 To do so, make sure you have updated your installed world to at least
 r212904 (which has the most recently imported clang/llvm snapshot), and
 put the following in /etc/src.conf:

 .if !defined(CC) || ${CC} == cc
 CC=clang
 .endif
 .if !defined(CXX) || ${CXX} == c++
 CXX=clang++
 .endif
 # Don't die on warnings
 NO_WERROR=
 WERROR=

 Both world and kernel can also be installed, and should run properly,
 but please make sure you have a way to revert if anything unexpected
 happens. :)  Alternatively, just install into a chroot to try it out
 from there.

 Some additional information can be found on this wiki page:

 http://wiki.freebsd.org/BuildingFreeBSDWithClang

 Thanks to all the people that made this possible, especially Roman
 Divacky, Ed Schouten, Rui Paulo, and of course the clang/llvm
 developers.

When to expect to get rid of GNU as and other binutils tools?
___
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 now builds world and kernel, on i386 and amd64

2010-09-25 Thread Dimitry Andric

On 2010-09-25 21:16, Paul B Mahol wrote:

On 9/22/10, Dimitry Andricd...@freebsd.org  wrote:

As of r212979, you should now be able to build world and kernel on i386
and amd64 with clang, without any additional patches!

...

When to expect to get rid of GNU as and other binutils tools?


Work is progressing steadily on the clang/llvm integrated assembler,
which removes the need for an external assembler such as gas, and which
should also reduce compile times further.  This is really in alpha state
right now, but Roman Divacky (who is one of the active contributors) can
probably tell more about its progress.

Another important component is of course the linker, but I am not aware
of a similar project to replace that; excepting gold, but that is a
GPLv3 project too, unfortunately.

There is also an LLDB Debugger project in the very early stages of
development, see http://lldb.llvm.org/, but this works only on Mac OS X
now.  Volunteers are invited to port this to FreeBSD. :)

Not binutils related, but still possibly interesting to FreeBSD, are
also the libc++ and compiler-rt projects, a GNU libstdc++ replacement
and a GNU libgcc replacement, respectively.  See http://libcxx.llvm.org/
and http://compiler-rt.llvm.org/ for more information.
___
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 now builds world and kernel, on i386 and amd64

2010-09-25 Thread Roman Divacky
On Sat, Sep 25, 2010 at 10:23:44PM +0200, Dimitry Andric wrote:
 On 2010-09-25 21:16, Paul B Mahol wrote:
 On 9/22/10, Dimitry Andricd...@freebsd.org  wrote:
 As of r212979, you should now be able to build world and kernel on i386
 and amd64 with clang, without any additional patches!
 ...
 When to expect to get rid of GNU as and other binutils tools?
 
 Work is progressing steadily on the clang/llvm integrated assembler,
 which removes the need for an external assembler such as gas, and which
 should also reduce compile times further.  This is really in alpha state
 right now, but Roman Divacky (who is one of the active contributors) can
 probably tell more about its progress.

yes, this will give us BSDL modern asm (ie. things like SSE4.x works etc.)
on X86/arm

 Another important component is of course the linker, but I am not aware
 of a similar project to replace that; excepting gold, but that is a
 GPLv3 project too, unfortunately.
 
I know of something that may happen, it's in planning stage now

 There is also an LLDB Debugger project in the very early stages of
 development, see http://lldb.llvm.org/, but this works only on Mac OS X
 now.  Volunteers are invited to port this to FreeBSD. :)
 
 Not binutils related, but still possibly interesting to FreeBSD, are
 also the libc++ and compiler-rt projects, a GNU libstdc++ replacement
 and a GNU libgcc replacement, respectively.  See http://libcxx.llvm.org/
 and http://compiler-rt.llvm.org/ for more information.

there's also elftoolchain: http://sourceforge.net/apps/trac/elftoolchain/
___
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 now builds world and kernel, on i386 and amd64

2010-09-25 Thread b. f.
Dmitry Andric wrote:
On 2010-09-25 21:16, Paul B Mahol wrote:
 When to expect to get rid of GNU as and other binutils tools?

Work is progressing steadily on the clang/llvm integrated assembler,
which removes the need for an external assembler such as gas, and which
should also reduce compile times further.  This is really in alpha state
right now, but Roman Divacky (who is one of the active contributors) can
probably tell more about its progress.

Another important component is of course the linker, but I am not aware
of a similar project to replace that; excepting gold, but that is a
GPLv3 project too, unfortunately.

There has been another effort underway for some time:

http://sourceforge.net/apps/trac/elftoolchain/

Perhaps some coordination between those working on llvm in FreeBSD,
and the elftoolchain project, would be helpful?

b.
___
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 now builds world and kernel, on i386 and amd64

2010-09-24 Thread Bartosz Stec

 W dniu 2010-09-23 16:45, Dimitry Andric pisze:

On 2010-09-23 13:24, Bartosz Stec wrote:

I cannot reproduce this here, running the exact command printed above.
What is the output of /usr/bin/clang++ -v ?

# /usr/bin/clang++ -v
FreeBSD clang version 2.8 (branches/release_28 114020) 20100917
Target: i386-undermydesk-freebsd9.0
Thread model: posix


Right, that seems okay enough.  Any other information you can give to
help reproduce this issue would be nice.  For example, do you have any
special stuff in src.conf or make.conf?  Do you have more than one
clang++ in your PATH, maybe an old port version?


So I've started from scratch:

1. rm -Rf /usr/src/*
2. portinstall subversion-freebsd
3. checkout fresh sources
4. disabled clang debugging in/src/lib/clang/clang.build.mk for speed 
measuring

5. rebuild and reinstall world  kernel via GCC (without src.conf)
6. after new world is alive rebuild and reinstall world  kernel via 
CLANG (with src.conf, and no problem with this part)
7. Another buildworld try and here's the bug again (output seems to be 
different only because of disables debugging):


   === lib/clang/libllvmsupport (obj,depend,all,install)
   /usr/obj/usr/src/tmp/usr/src/lib/clang/libllvmsupport created for
   /usr/src/lib/clang/libllvmsupport
   rm -f .depend
   CC='clang' mkdep -f .depend -a   
   -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/include

   -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/tools/clang/include
   -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support -I.
   
-I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/../../lib/clang/include
   -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD -D__STDC_LIMIT_MACROS
   -D__STDC_CONSTANT_MACROS -DNDEBUG
   -DLLVM_HOSTTRIPLE=\i386-undermydesk-freebsd9.0\
   -I/usr/obj/usr/src/tmp/legacy/usr/include
   /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/regcomp.c
   
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/regerror.c
   /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/regexec.c
   /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/regfree.c
   
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/regstrlcpy.c
   CC='clang' mkdep -f .depend -a   
   -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/include

   -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/tools/clang/include
   -I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support -I.
   
-I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/../../lib/clang/include
   -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD -D__STDC_LIMIT_MACROS
   -D__STDC_CONSTANT_MACROS -DNDEBUG
   -DLLVM_HOSTTRIPLE=\i386-undermydesk-freebsd9.0\
   -I/usr/obj/usr/src/tmp/legacy/usr/include   
   /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/APFloat.cpp

   /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/APInt.cpp
   
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/APSInt.cpp
   
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Allocator.cpp
   
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/CommandLine.cpp
   
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/ConstantRange.cpp
   
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/CrashRecoveryContext.cpp
   
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/DAGDeltaAlgorithm.cpp
   /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Debug.cpp
   
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/DeltaAlgorithm.cpp
   /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Dwarf.cpp
   
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/ErrorHandling.cpp
   
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/FoldingSet.cpp
   
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/FormattedStream.cpp
   
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/GraphWriter.cpp
   
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/ManagedStatic.cpp
   
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/MemoryBuffer.cpp
   
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/PluginLoader.cpp
   
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/PrettyStackTrace.cpp
   /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Regex.cpp
   
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/SmallPtrSet.cpp
   
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/SmallVector.cpp
   
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/SourceMgr.cpp
   
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Statistic.cpp
   
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/StringExtras.cpp
   

Re: Clang now builds world and kernel, on i386 and amd64

2010-09-24 Thread Dimitry Andric

On 2010-09-24 13:24, Bartosz Stec wrote:

make.conf (note that NOCCACHE was defined in environment during all
builds so ccache wasn't used):

 CPUTYPE=athlon-xp

 # default build settings for ports collection
 .if ${.CURDIR:M*/ports/*}  !defined(NOCCACHE)
 CFLAGS=-O2 -pipe
 .endif

 # default build settings for base system
 .if ${.CURDIR:M*/usr/src/*} || ${.CURDIR:M*/usr/obj/*}

 CFLAGS=-O2 -pipe
 COPTFLAGS=-O2 -pipe

 .if !defined(NOCCACHE)
 CC:=${CC:C,^cc,/usr/local/libexec/ccache/world-cc,1}
 CXX:=${CXX:C,^c\+\+,/usr/local/libexec/ccache/world-c++,1}
 .endif
 .endif

 # added by use.perl 2010-08-10 10:21:21
 PERL_VERSION=5.10.1


Could you please try to rename this make.conf to e.g. make.conf.disable,
and retry the world build?
___
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 now builds world and kernel, on i386 and amd64

2010-09-24 Thread Bartosz Stec

 W dniu 2010-09-24 13:47, Dimitry Andric pisze:

On 2010-09-24 13:24, Bartosz Stec wrote:

make.conf (note that NOCCACHE was defined in environment during all
builds so ccache wasn't used):

 CPUTYPE=athlon-xp

 # default build settings for ports collection
 .if ${.CURDIR:M*/ports/*}  !defined(NOCCACHE)
 CFLAGS=-O2 -pipe
 .endif

 # default build settings for base system
 .if ${.CURDIR:M*/usr/src/*} || ${.CURDIR:M*/usr/obj/*}

 CFLAGS=-O2 -pipe
 COPTFLAGS=-O2 -pipe

 .if !defined(NOCCACHE)
 CC:=${CC:C,^cc,/usr/local/libexec/ccache/world-cc,1}
 CXX:=${CXX:C,^c\+\+,/usr/local/libexec/ccache/world-c++,1}
 .endif
 .endif

 # added by use.perl 2010-08-10 10:21:21
 PERL_VERSION=5.10.1


Could you please try to rename this make.conf to e.g. make.conf.disable,
and retry the world build?

Still the same without make.conf. My personal guess is, that clang 
builded by clang with CPUTYPE=athlon-xp is somehow broken. I don't think 
CFLAGS=-O2 -pipe could do any harm, and also note that clang builded by 
GCC with exactly the same make.conf has no problems with world building :)


--
Bartosz Stec


___
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 now builds world and kernel, on i386 and amd64

2010-09-24 Thread Dimitry Andric

On 2010-09-24 14:13, Bartosz Stec wrote:

Could you please try to rename this make.conf to e.g. make.conf.disable,
and retry the world build?

Still the same without make.conf. My personal guess is, that clang
builded by clang with CPUTYPE=athlon-xp is somehow broken. I don't think
CFLAGS=-O2 -pipe could do any harm, and also note that clang builded by
GCC with exactly the same make.conf has no problems with world building :)


I still cannot reproduce your issue...  To check, I have built world
with CPUTYPE=athlon-xp, verified it used -O2 -pipe -march=athlon-xp as
compilation flags for the world stage, and installed the resulting clang
executables.

Those clang executables do not exhibit the same problem as yours do;
they can build tblgen (during the bootstrap-tools stage) fine.

I suggest you comment out the CPUTYPE macro in make.conf for now,
rebuild your world with gcc, and then rebuild it with clang again, to
see if the issue goes away.
___
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 now builds world and kernel, on i386 and amd64

2010-09-23 Thread Roman Divacky
On Wed, Sep 22, 2010 at 11:15:47PM +0200, Bartosz Stec wrote:
  On 2010-09-22 22:42, Rene Ladan wrote:
 
 Just tried it. World has been builded without any problems, but stge
 kernel module failed to compile:
 
 ===  stge (all)
 clang -O2 -pipe -march=athlon-xp -fno-strict-aliasing -D_KERNEL
 -DKLD_MODULE -nostdinc   -DHAVE_KERNEL_OPTION_HEADERS -include
 /usr/obj/usr/src/sys/ATHLON9/opt_global.h -I. -I@ -I@/contrib/altq
 -fno-common  -I/usr/obj/usr/src/sys/ATHLON9  -mno-mmx -mno-3dnow
 -mno-sse -mno-sse2 -mno-sse3 -ffreestanding -fstack-protector
 -std=iso9899:1999 -fstack-protector -Wall -Wredundant-decls
 -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes
 -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign
 -fformat-extensions -c /usr/src/sys/modules/stge/../../dev/stge/if_stge.c
 /usr/src/sys/modules/stge/../../dev/stge/if_stge.c:1947:5: error:
 'break' statement not in loop or switch statement
  break;
  ^
 /usr/src/sys/modules/stge/../../dev/stge/if_stge.c:1953:6: error:
 'break' statement not in loop or switch statement
  break
 
 Hmm, works for me:
 acer# ls -l /boot/kernel/if_stge.ko*
 -r-xr-xr-x  1 root  wheel   39344 Sep 22 13:34 /boot/kernel/if_stge.ko
 -r-xr-xr-x  1 root  wheel  218248 Sep 22 13:34
 /boot/kernel/if_stge.ko.symbols
 acer#
 
 This is with the default GENERIC kernel.
 
 Rene
 Problem wasn't clang related, but caused by stge changes in r212973, and 
 it has already been fixed (in r213000).
 I will post comparison of building times and results using 
 gcc/clang/ccache/noccache on my box soon :)

if you want to post any build-time numbers for clang please 

  -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS #-DNDEBUG

uncomment the -DNDEBUG on this line in lib/clang/clang.build.mk
and rebuild it otherwise you are using Release+Asserts build of
clang which is some 30% slower than the normal one...
___
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 now builds world and kernel, on i386 and amd64

2010-09-23 Thread Bartosz Stec

 On 2010-09-23 08:51, Roman Divacky wrote:

I will post comparison of building times and results using
gcc/clang/ccache/noccache on my box soon :)

if you want to post any build-time numbers for clang please

   -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS #-DNDEBUG

uncomment the -DNDEBUG on this line in lib/clang/clang.build.mk
and rebuild it otherwise you are using Release+Asserts build of
clang which is some 30% slower than the normal one...
Just rebooted system with kernel builded by clang. After 'make 
installworld' I ran mergemaster and it seems that headers in most of 
configuration files are wrong, for instance:


  *** Displaying differences between ./etc/csh.cshrc and installed
   version:

   --- /etc/csh.cshrc  2009-09-21 11:01:51.0 +0200
   +++ ./etc/csh.cshrc 2010-09-23 12:12:47.553768640 +0200
   @@ -1,6 +1,3 @@
   -# $FreeBSD: src/etc/csh.cshrc,v 1.3 1999/08/27 23:23:40 peter Exp $
   +# $FreeBSD$
   (...)

Should I rebuild and provide output?

--
Bartosz Stec
___
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 now builds world and kernel, on i386 and amd64

2010-09-23 Thread Bartosz Stec

 On 2010-09-23 08:51, Roman Divacky wrote:

if you want to post any build-time numbers for clang please

   -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS #-DNDEBUG

uncomment the -DNDEBUG on this line in lib/clang/clang.build.mk
and rebuild it otherwise you are using Release+Asserts build of
clang which is some 30% slower than the normal one...
___
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
When i try to rebuild world again (machine has world and kernel builded 
with clang) I cought following problem at the very beginning:


--
 World build started on Thu Sep 23 12:46:55 CEST 2010
--

--
 Rebuilding the temporary build tree
--
rm -rf /usr/obj/usr/src/tmp
mkdir -p /usr/obj/usr/src/tmp/lib
mkdir -p /usr/obj/usr/src/tmp/usr
mkdir -p /usr/obj/usr/src/tmp/legacy/usr
mtree -deU -f /usr/src/etc/mtree/BSD.usr.dist  -p 
/usr/obj/usr/src/tmp/legacy/usr /dev/null
mtree -deU -f /usr/src/etc/mtree/BSD.usr.dist  -p 
/usr/obj/usr/src/tmp/usr /dev/null
mtree -deU -f /usr/src/etc/mtree/BSD.include.dist  -p 
/usr/obj/usr/src/tmp/usr/include /dev/null

ln -sf /usr/src/sys /usr/obj/usr/src/tmp

--
 stage 1.1: legacy release compatibility shims
--
cd /usr/src; MAKEOBJDIRPREFIX=/usr/obj/usr/src/tmp  INSTALL=sh 
/usr/src/tools/install.sh  
PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/sbin:/bin:/usr/sbin:/usr/bin  
WORLDTMP=/usr/obj/usr/src/tmp  VERSION=FreeBSD 9.0-CURRENT i386 
900021  MAKEFLAGS=-m /usr/src/tools/build/mk  -m /usr/src/share/mk 
make -f Makefile.inc1  DESTDIR=  BOOTSTRAPPING=900021  SSP_CFLAGS=  
-DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN  -DNO_PIC 
-DWITHOUT_PROFILE -DNO_SHARED  -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF legacy

=== tools/build (obj,includes,depend,all,install)
/usr/obj/usr/src/tmp/usr/src/tools/build created for /usr/src/tools/build
cd /usr/src/tools/build; make buildincludes; make installincludes
rm -f .depend
CC='clang' mkdep -f .depend -a
-I/usr/obj/usr/src/tmp/legacy/usr/include /usr/src/tools/build/dummy.c
clang -O2 -pipe -std=gnu99   -I/usr/obj/usr/src/tmp/legacy/usr/include 
-c /usr/src/tools/build/dummy.c

building static egacy library
ranlib libegacy.a
sh /usr/src/tools/install.sh -C -o root -g wheel -m 444   libegacy.a 
/usr/obj/usr/src/tmp/legacy/usr/lib


--
 stage 1.2: bootstrap tools
--
cd /usr/src; MAKEOBJDIRPREFIX=/usr/obj/usr/src/tmp  INSTALL=sh 
/usr/src/tools/install.sh  
PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/sbin:/bin:/usr/sbin:/usr/bin  
WORLDTMP=/usr/obj/usr/src/tmp  VERSION=FreeBSD 9.0-CURRENT i386 
900021  MAKEFLAGS=-m /usr/src/tools/build/mk  -m /usr/src/share/mk 
make -f Makefile.inc1  DESTDIR=  BOOTSTRAPPING=900021  SSP_CFLAGS=  
-DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN  -DNO_PIC 
-DWITHOUT_PROFILE -DNO_SHARED  -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF 
bootstrap-tools

=== lib/clang/libllvmsupport (obj,depend,all,install)
/usr/obj/usr/src/tmp/usr/src/lib/clang/libllvmsupport created for 
/usr/src/lib/clang/libllvmsupport

rm -f .depend
CC='clang' mkdep -f .depend -a
-I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/include 
-I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/tools/clang/include 
-I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support 
-I. 
-I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/../../lib/clang/include 
-DLLVM_ON_UNIX -DLLVM_ON_FREEBSD -D__STDC_LIMIT_MACROS 
-D__STDC_CONSTANT_MACROS -DNDEBUG 
-DLLVM_HOSTTRIPLE=\i386-undermydesk-freebsd9.0\ 
-I/usr/obj/usr/src/tmp/legacy/usr/include 
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/regcomp.c 
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/regerror.c 
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/regexec.c 
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/regfree.c 
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/regstrlcpy.c
CC='clang' mkdep -f .depend -a
-I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/include 
-I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/tools/clang/include 
-I/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support 
-I. 

Re: Clang now builds world and kernel, on i386 and amd64

2010-09-23 Thread Dimitry Andric

On 2010-09-23 12:20, Bartosz Stec wrote:

 --- /etc/csh.cshrc  2009-09-21 11:01:51.0 +0200
 +++ ./etc/csh.cshrc 2010-09-23 12:12:47.553768640 +0200
 @@ -1,6 +1,3 @@
 -# $FreeBSD: src/etc/csh.cshrc,v 1.3 1999/08/27 23:23:40 peter Exp $
 +# $FreeBSD$
 (...)



You must use the subversion-freebsd port to checkout FreeBSD sources,
not the regular subversion port.

Also, if you switch from CVS or csup-based checkouts to Subversion-based
checkouts, you will have to deal with a lot of these changes.

Fortunately, you should only have to do this once.
___
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 now builds world and kernel, on i386 and amd64

2010-09-23 Thread Dimitry Andric

On 2010-09-23 12:55, Bartosz Stec wrote:

0.  Program arguments: /usr/bin/clang++ -cc1 -triple
i386-undermydesk-freebsd9.0 -S -disable-free -main-file-name APFloat.cpp
-mrelocation-model static -mdisable-fp-elim -mconstructor-aliases
-target-cpu i486 -resource-dir /usr/lib/clang/2.8 -D LLVM_ON_UNIX -D
LLVM_ON_FREEBSD -D __STDC_LIMIT_MACROS -D __STDC_CONSTANT_MACROS -D
NDEBUG -D LLVM_HOSTTRIPLE=i386-undermydesk-freebsd9.0 -I
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/include -I
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/tools/clang/include
-I /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support
-I . -I
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/../../lib/clang/include
-I /usr/obj/usr/src/tmp/legacy/usr/include -O2 -ferror-limit 19
-fmessage-length 205 -fgnu-runtime -fdiagnostics-show-option
-fcolor-diagnostics -o /tmp/cc-lvFfGd.s -x c++
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/APFloat.cpp
1.eof  parser at end of file
2.  Code generation
3.  Running pass 'Linear Scan Register Allocator' on function
'@_ZN4llvm7APFloat28convertFromHexadecimalStringENS_9StringRefENS0_12roundingModeE'


I cannot reproduce this here, running the exact command printed above.
What is the output of /usr/bin/clang++ -v ?
___
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 now builds world and kernel, on i386 and amd64

2010-09-23 Thread Bartosz Stec

 On 2010-09-23 13:21, Dimitry Andric wrote:


I cannot reproduce this here, running the exact command printed above.
What is the output of /usr/bin/clang++ -v ? 

# /usr/bin/clang++ -v
FreeBSD clang version 2.8 (branches/release_28 114020) 20100917
Target: i386-undermydesk-freebsd9.0
Thread model: posix

--
Bartosz Stec
___
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 now builds world and kernel, on i386 and amd64

2010-09-23 Thread Dimitry Andric

On 2010-09-23 13:24, Bartosz Stec wrote:

I cannot reproduce this here, running the exact command printed above.
What is the output of /usr/bin/clang++ -v ?

# /usr/bin/clang++ -v
FreeBSD clang version 2.8 (branches/release_28 114020) 20100917
Target: i386-undermydesk-freebsd9.0
Thread model: posix


Right, that seems okay enough.  Any other information you can give to
help reproduce this issue would be nice.  For example, do you have any
special stuff in src.conf or make.conf?  Do you have more than one
clang++ in your PATH, maybe an old port version?

Also, can you please post the output of the commands:

whereis clang
clang++ -v -O2 -save-temps -I/usr/src/contrib/llvm/include 
-I/usr/src/contrib/llvm/tools/clang/include -I/usr/src/contrib/llvm/lib/Support -I. 
-I/usr/src/lib/clang/include -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD -D__STDC_LIMIT_MACROS 
-D__STDC_CONSTANT_MACROS -DNDEBUG 
-DLLVM_HOSTTRIPLE=\i386-undermydesk-freebsd9.0\ -fno-exceptions 
-I/usr/obj/usr/src/tmp/legacy/usr/include -c /usr/src/contrib/llvm/lib/Support/APFloat.cpp

and the resulting APFloat.ii, APFloat.s (if clang manages to produce
it)?
___
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 now builds world and kernel, on i386 and amd64

2010-09-22 Thread René Ladan
2010/9/22 Dimitry Andric d...@freebsd.org:
 Hi,

 As of r212979, you should now be able to build world and kernel on i386
 and amd64 with clang, without any additional patches!

 To do so, make sure you have updated your installed world to at least
 r212904 (which has the most recently imported clang/llvm snapshot), and
 put the following in /etc/src.conf:

 .if !defined(CC) || ${CC} == cc
 CC=clang
 .endif
 .if !defined(CXX) || ${CXX} == c++
 CXX=clang++
 .endif
 # Don't die on warnings
 NO_WERROR=
 WERROR=

I've uploaded a typescript of make buildworld  make buildkernel of
an 9.0-amd64
system running r212906 and building r212994 with the clang-in-HEAD:

ftp://rene-ladan.nl/pub/freebsd/bwk-clang-native.bz2
SIZE = 933354 bytes (uncompressed 36308187 bytes)
SHA256 = f97be8fb0d310ceb2e16dfc3919aeb68b57312431d7e879b6cce84b1cf8ba851

Now for the install phase, after some backups.

Rene
___
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 now builds world and kernel, on i386 and amd64

2010-09-22 Thread Bartosz Stec

 On 2010-09-22 12:42, René Ladan wrote:

2010/9/22 Dimitry Andricd...@freebsd.org:

Hi,

As of r212979, you should now be able to build world and kernel on i386
and amd64 with clang, without any additional patches!

To do so, make sure you have updated your installed world to at least
r212904 (which has the most recently imported clang/llvm snapshot), and
put the following in /etc/src.conf:

.if !defined(CC) || ${CC} == cc
CC=clang
.endif
.if !defined(CXX) || ${CXX} == c++
CXX=clang++
.endif
# Don't die on warnings
NO_WERROR=
WERROR=



Just tried it. World has been builded without any problems, but stge 
kernel module failed to compile:


=== stge (all)
clang -O2 -pipe -march=athlon-xp -fno-strict-aliasing -D_KERNEL 
-DKLD_MODULE -nostdinc   -DHAVE_KERNEL_OPTION_HEADERS -include 
/usr/obj/usr/src/sys/ATHLON9/opt_global.h -I. -I@ -I@/contrib/altq 
-fno-common  -I/usr/obj/usr/src/sys/ATHLON9  -mno-mmx -mno-3dnow 
-mno-sse -mno-sse2 -mno-sse3 -ffreestanding -fstack-protector 
-std=iso9899:1999 -fstack-protector -Wall -Wredundant-decls 
-Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes 
-Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign 
-fformat-extensions -c /usr/src/sys/modules/stge/../../dev/stge/if_stge.c
/usr/src/sys/modules/stge/../../dev/stge/if_stge.c:1947:5: error: 
'break' statement not in loop or switch statement

break;
^
/usr/src/sys/modules/stge/../../dev/stge/if_stge.c:1953:6: error: 
'break' statement not in loop or switch statement

break

--
Bartosz Stec
___
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 now builds world and kernel, on i386 and amd64

2010-09-22 Thread Pyun YongHyeon
On Wed, Sep 22, 2010 at 06:47:50PM +0200, Bartosz Stec wrote:
  On 2010-09-22 12:42, Ren? Ladan wrote:
 2010/9/22 Dimitry Andricd...@freebsd.org:
 Hi,
 
 As of r212979, you should now be able to build world and kernel on i386
 and amd64 with clang, without any additional patches!
 
 To do so, make sure you have updated your installed world to at least
 r212904 (which has the most recently imported clang/llvm snapshot), and
 put the following in /etc/src.conf:
 
 .if !defined(CC) || ${CC} == cc
 CC=clang
 .endif
 .if !defined(CXX) || ${CXX} == c++
 CXX=clang++
 .endif
 # Don't die on warnings
 NO_WERROR=
 WERROR=
 
 
 Just tried it. World has been builded without any problems, but stge 
 kernel module failed to compile:
 
 === stge (all)
 clang -O2 -pipe -march=athlon-xp -fno-strict-aliasing -D_KERNEL 
 -DKLD_MODULE -nostdinc   -DHAVE_KERNEL_OPTION_HEADERS -include 
 /usr/obj/usr/src/sys/ATHLON9/opt_global.h -I. -I@ -I@/contrib/altq 
 -fno-common  -I/usr/obj/usr/src/sys/ATHLON9  -mno-mmx -mno-3dnow 
 -mno-sse -mno-sse2 -mno-sse3 -ffreestanding -fstack-protector 
 -std=iso9899:1999 -fstack-protector -Wall -Wredundant-decls 
 -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes 
 -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign 
 -fformat-extensions -c /usr/src/sys/modules/stge/../../dev/stge/if_stge.c
 /usr/src/sys/modules/stge/../../dev/stge/if_stge.c:1947:5: error: 
 'break' statement not in loop or switch statement
 break;
 ^
 /usr/src/sys/modules/stge/../../dev/stge/if_stge.c:1953:6: error: 
 'break' statement not in loop or switch statement
 break
 

I committed the fix. Sorry for the breakage.
___
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 now builds world and kernel, on i386 and amd64

2010-09-22 Thread Rene Ladan
On 22-09-2010 18:45, Bartosz Stec wrote:
  On 2010-09-22 12:42, René Ladan wrote:
 2010/9/22 Dimitry Andricd...@freebsd.org:
 Hi,

 As of r212979, you should now be able to build world and kernel on i386
 and amd64 with clang, without any additional patches!

 To do so, make sure you have updated your installed world to at least
 r212904 (which has the most recently imported clang/llvm snapshot), and
 put the following in /etc/src.conf:

 .if !defined(CC) || ${CC} == cc
 CC=clang
 .endif
 .if !defined(CXX) || ${CXX} == c++
 CXX=clang++
 .endif
 # Don't die on warnings
 NO_WERROR=
 WERROR=


 Just tried it. World has been builded without any problems, but stge
 kernel module failed to compile:
 
 === stge (all)
 clang -O2 -pipe -march=athlon-xp -fno-strict-aliasing -D_KERNEL
 -DKLD_MODULE -nostdinc   -DHAVE_KERNEL_OPTION_HEADERS -include
 /usr/obj/usr/src/sys/ATHLON9/opt_global.h -I. -I@ -I@/contrib/altq
 -fno-common  -I/usr/obj/usr/src/sys/ATHLON9  -mno-mmx -mno-3dnow
 -mno-sse -mno-sse2 -mno-sse3 -ffreestanding -fstack-protector
 -std=iso9899:1999 -fstack-protector -Wall -Wredundant-decls
 -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes
 -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign
 -fformat-extensions -c /usr/src/sys/modules/stge/../../dev/stge/if_stge.c
 /usr/src/sys/modules/stge/../../dev/stge/if_stge.c:1947:5: error:
 'break' statement not in loop or switch statement
 break;
 ^
 /usr/src/sys/modules/stge/../../dev/stge/if_stge.c:1953:6: error:
 'break' statement not in loop or switch statement
 break
 
Hmm, works for me:
acer# ls -l /boot/kernel/if_stge.ko*
-r-xr-xr-x  1 root  wheel   39344 Sep 22 13:34 /boot/kernel/if_stge.ko
-r-xr-xr-x  1 root  wheel  218248 Sep 22 13:34
/boot/kernel/if_stge.ko.symbols
acer#

This is with the default GENERIC kernel.

Rene
-- 
http://www.rene-ladan.nl/

GPG fingerprint = ADBC ECCD EB5F A6B4 549F  600D 8C9E 647A E564 2BFC
(subkeys.pgp.net)
___
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 now builds world and kernel, on i386 and amd64

2010-09-22 Thread Bartosz Stec

 On 2010-09-22 22:42, Rene Ladan wrote:


Just tried it. World has been builded without any problems, but stge
kernel module failed to compile:

===  stge (all)
clang -O2 -pipe -march=athlon-xp -fno-strict-aliasing -D_KERNEL
-DKLD_MODULE -nostdinc   -DHAVE_KERNEL_OPTION_HEADERS -include
/usr/obj/usr/src/sys/ATHLON9/opt_global.h -I. -I@ -I@/contrib/altq
-fno-common  -I/usr/obj/usr/src/sys/ATHLON9  -mno-mmx -mno-3dnow
-mno-sse -mno-sse2 -mno-sse3 -ffreestanding -fstack-protector
-std=iso9899:1999 -fstack-protector -Wall -Wredundant-decls
-Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes
-Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign
-fformat-extensions -c /usr/src/sys/modules/stge/../../dev/stge/if_stge.c
/usr/src/sys/modules/stge/../../dev/stge/if_stge.c:1947:5: error:
'break' statement not in loop or switch statement
 break;
 ^
/usr/src/sys/modules/stge/../../dev/stge/if_stge.c:1953:6: error:
'break' statement not in loop or switch statement
 break


Hmm, works for me:
acer# ls -l /boot/kernel/if_stge.ko*
-r-xr-xr-x  1 root  wheel   39344 Sep 22 13:34 /boot/kernel/if_stge.ko
-r-xr-xr-x  1 root  wheel  218248 Sep 22 13:34
/boot/kernel/if_stge.ko.symbols
acer#

This is with the default GENERIC kernel.

Rene
Problem wasn't clang related, but caused by stge changes in r212973, and 
it has already been fixed (in r213000).
I will post comparison of building times and results using 
gcc/clang/ccache/noccache on my box soon :)

___
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