From owner-freebsd-sparc64@FreeBSD.ORG Tue Jan 21 17:08:10 2014 Return-Path: Delivered-To: sparc64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF30378 for ; Tue, 21 Jan 2014 17:08:10 +0000 (UTC) Received: from vlakno.cz (mail.vlakno.cz [95.129.96.251]) by mx1.freebsd.org (Postfix) with ESMTP id 0D9AC1241 for ; Tue, 21 Jan 2014 17:08:09 +0000 (UTC) Received: by vlakno.cz (Postfix, from userid 1002) id 0CAD01CC5598; Tue, 21 Jan 2014 18:08:01 +0100 (CET) Date: Tue, 21 Jan 2014 18:08:01 +0100 From: Roman Divacky To: Craig Butler Subject: Re: Call for help: clang/llvm for sparc64 Message-ID: <20140121170801.GA56661@freebsd.org> References: <20140117183733.GA93251@freebsd.org> <1389984564.3414.5.camel@atlas.lerwick.hopto.org> <20140117221330.GA2788@freebsd.org> <1390175474.8376.3.camel@atlas.lerwick.hopto.org> <3866560.132.1390324121556.JavaMail.craig@w520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3866560.132.1390324121556.JavaMail.craig@w520> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: sparc64@freebsd.org X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jan 2014 17:08:10 -0000 Yes, you need to remove all the std*.h from clang as freebsd uses its own. I also already have a fix for the tls issue, so you dont have to keep working on that :) You're welcome to test other stuff though. On Tue, Jan 21, 2014 at 05:05:33PM +0000, Craig Butler wrote: > > > ----- Original Message ----- > > From: "Craig Butler" > > To: "Roman Divacky" > > Cc: sparc64@freebsd.org > > Sent: Sunday, 19 January, 2014 11:51:14 PM > > Subject: Re: Call for help: clang/llvm for sparc64 > > > > > > On Fri, 2014-01-17 at 23:13 +0100, Roman Divacky wrote: > > > fwiw, we have a small testcase and I filed a bug in upstream llvm > > > > > > http://llvm.org/bugs/show_bug.cgi?id=18521 > > > > > > A big thank you, to jmg@ for providing the testcase and analyzing > > > the bug. > > > > > > Roman > > > > > > On Fri, Jan 17, 2014 at 06:49:24PM +0000, Craig Butler wrote: > > > > On Fri, 2014-01-17 at 19:37 +0100, Roman Divacky wrote: > > > > > We got further. It looks like the problem is TLS related. It's > > > > > crashing > > > > > in __getCurrentRuneLocale(). > > > > > > > > > > And to correct myself - you need to do --enable-target=sparc > > > > > (not sparc64) > > > > > and you need to compile with gcc48. > > > > > > > > > > Anyway, start using llvm on sparc64, it's getting usable :) So > > > > > more usage > > > > > is better. > > > > > > > > > > On Fri, Jan 17, 2014 at 01:12:42PM +0000, Craig Butler wrote: > > > > > > Hi Roman and list. > > > > > > > > > > > > I've got some spare time and sparc64 kit in the rack. I can > > > > > > help out and walk through anything you need. > > > > > > > > > > > > Kind Regards > > > > > > > > > > > > Craig Butler > > > > > > > > > > > > Roman Divacky wrote: > > > > > > > > > > > > >Hi! > > > > > > > > > > > > > >LLVM is getting a sparc64 backend. It can even selfhost on > > > > > > >linux. But it cant > > > > > > >on FreeBSD. I am wondering what causes that difference. > > > > > > > > > > > > > >A small test case where the difference can be seen is > > > > > > >compiling tcsh from > > > > > > >base. The gethost utility used during the build just > > > > > > >coredumps. I suspect > > > > > > >fixing that might get us on par with linux. > > > > > > > > > > > > > >So I am looking for someone who is willing to compile > > > > > > >llvm/clang and > > > > > > >analyze whats wrong with gethost in tcsh compilation. > > > > > > > > > > > > > >This is how to do it (you need trunk llvm/clang): > > > > > > > > > > > > > >svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm > > > > > > >cd llvm/ > > > > > > >svn co http://llvm.org/svn/llvm-project/cfe/trunk clang > > > > > > >cd ../ > > > > > > >CFLAGS=-fno-strict-aliasing CXXFLAGS=-fno-strict-aliasing > > > > > > >./configure --enable-optimized --enable-targets=sparc64 > > > > > > >make > > > > > > >make install > > > > > > > > > > > > > >will give you a clang binary that you can use for tcsh > > > > > > >compilation: > > > > > > > > > > > > > >cd /usr/src/bin/csh > > > > > > >CC=clang make > > > > > > > > > > > > > >I am more than willing to help with llvm/clang side of this > > > > > > >but I dont know > > > > > > >anything about sparc64 so I need help. But please contact me > > > > > > >if you want to > > > > > > >help! > > > > > > > > > > > > > >Thanks, Roman > > > > > > > > Thanks Roman.. I'll compile gcc48 on my tinderbox and try again. > > > > > > > > Report back soon > > > > > > > > Regards > > > > > > > > Craig Butler > > > > Hello Folks > > > > For anyone else trying to build llvm/clang I have gcc48 pkgng > > available (should save a day of compiling) > > > > I have also found that clang checkout needs to happen in llvm/tools > > for the llvm build to pick it up. > > > > I needed to use gmake and gmake install because BSD make was > > complaining about "Error expanding embedded variable" > > > > Hopefully a llvm and clang build soon (still compiling!!) > > > > Kind Regards > > > > Craig Butler > > > > _______________________________________________ > > freebsd-sparc64@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-sparc64 > > To unsubscribe, send any mail to > > "freebsd-sparc64-unsubscribe@freebsd.org" > > > > Finally got llvm and clang compiled and installed (compiled tarball available if anyone wants it !) > > My compile of csh doesn't segfault it errors out moaning about a load of previous definitions... not sure what is going on > > # cd /usr/src/bin/csh/ > # CC=clang make > Warning: Object directory not changed from original /usr/src/bin/csh > grep '[FV]_' /usr/src/bin/csh/../../contrib/tcsh/ed.defns.c | grep '^#define' >> ed.defns.h > grep 'ERR_' /usr/src/bin/csh/../../contrib/tcsh/sh.err.c | grep '^#define' >> sh.err.h > clang -E -O2 -pipe -I. -I/usr/src/bin/csh -I/usr/src/bin/csh/../../contrib/tcsh -D_PATH_TCSHELL='"/bin/csh"' -std=gnu99 -Qunused-arguments -fstack-protector -Wsystem-headers -Werror -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-conversion -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter -Wno-parentheses /usr/src/bin/csh/../../contrib/tcsh/tc.const.c /usr/src/bin/csh/../../contrib/tcsh/sh.char.h config.h /usr/src/bin/csh/../../contrib/tcsh/config_f.h /usr/src/bin/csh/../../contrib/tcsh/sh.types.h sh.err.h -D_h_tc_const | grep 'Char STR' | sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | sort >> tc.const.h > In file included from /usr/src/bin/csh/../../contrib/tcsh/tc.const.c:33: > In file included from /usr/src/bin/csh/../../contrib/tcsh/sh.h:376: > /usr/local/bin/../lib/clang/3.5/include/stdarg.h:47:9: error: '__GNUC_VA_LIST' > macro redefined [-Werror] > #define __GNUC_VA_LIST 1 > ^ > /usr/include/machine/_types.h:106:9: note: previous definition is here > #define __GNUC_VA_LIST > ^ > 1 error generated. > cp /usr/src/bin/csh/iconv_stub.h iconv.h > clang -O2 -pipe -I. -I/usr/src/bin/csh -I/usr/src/bin/csh/../../contrib/tcsh -D_PATH_TCSHELL='"/bin/csh"' -DHAVE_ICONV -std=gnu99 -Qunused-arguments -fstack-protector -Wsystem-headers -Werror -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-conversion -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter -Wno-parentheses -c /usr/src/bin/csh/../../contrib/tcsh/sh.c > In file included from /usr/src/bin/csh/../../contrib/tcsh/sh.c:34: > In file included from /usr/src/bin/csh/../../contrib/tcsh/sh.h:50: > /usr/include/inttypes.h:37:19: error: redefinition of typedef 'wchar_t' is a C11 > feature [-Werror,-Wtypedef-redefinition] > typedef __wchar_t wchar_t; > ^ > /usr/local/bin/../lib/clang/3.5/include/stddef.h:65:24: note: previous > definition is here > typedef __WCHAR_TYPE__ wchar_t; > ^ > In file included from /usr/src/bin/csh/../../contrib/tcsh/sh.c:34: > In file included from /usr/src/bin/csh/../../contrib/tcsh/sh.h:97: > /usr/include/wchar.h:75:18: error: redefinition of typedef 'size_t' is a C11 > feature [-Werror,-Wtypedef-redefinition] > typedef __size_t size_t; > ^ > /usr/local/bin/../lib/clang/3.5/include/stddef.h:42:23: note: previous > definition is here > typedef __SIZE_TYPE__ size_t; > ^ > In file included from /usr/src/bin/csh/../../contrib/tcsh/sh.c:34: > In file included from /usr/src/bin/csh/../../contrib/tcsh/sh.h:376: > /usr/local/bin/../lib/clang/3.5/include/stdarg.h:47:9: error: '__GNUC_VA_LIST' > macro redefined [-Werror] > #define __GNUC_VA_LIST 1 > ^ > /usr/include/machine/_types.h:106:9: note: previous definition is here > #define __GNUC_VA_LIST > ^ > In file included from /usr/src/bin/csh/../../contrib/tcsh/sh.c:34: > In file included from /usr/src/bin/csh/../../contrib/tcsh/sh.h:376: > /usr/local/bin/../lib/clang/3.5/include/stdarg.h:48:27: error: redefinition of > typedef '__gnuc_va_list' is a C11 feature [-Werror,-Wtypedef-redefinition] > typedef __builtin_va_list __gnuc_va_list; > ^ > /usr/include/machine/_types.h:107:20: note: previous definition is here > typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/ > ^ > 4 errors generated. > *** [sh.o] Error code 1 > > Stop in /usr/src/bin/csh.