Re: [oi-dev] Clang and GCC6 runtime

2019-07-31 Thread Bob Friesenhahn

On Wed, 31 Jul 2019, Alexander Pyhalov via oi-dev wrote:


No, -fopenmp seems to be implemented wrong.
_REENTRANT is not defined, libgomp is not linked.
If we specify "clang++ omp.cc -fopenmp=libgomp -o omp", application 
is linked, but pragma parallel uses just one thread.


When -pthreads is used, _REENTRANT is undefined.

-pthread seems to work as expected.


There is an implementation of OpenMP for Clang which is independent of 
GOMP.


Regardless of current shortcomings, it is exciting that Clang is 
coming as an alternative to GCC.


Bob
--
Bob Friesenhahn
bfrie...@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,http://www.GraphicsMagick.org/
Public Key, http://www.simplesystems.org/users/bfriesen/public-key.txt

___
oi-dev mailing list
oi-dev@openindiana.org
https://openindiana.org/mailman/listinfo/oi-dev


Re: [oi-dev] Clang and GCC6 runtime

2019-07-31 Thread Alexander Pyhalov via oi-dev
It seems LLVM OpenMP library has not a single Solaris-specific line...

С уважением,
Александр Пыхалов,
программист отдела телекоммуникационной инфраструктуры
управления информационно-коммуникационной инфраструктуры ЮФУ



От: Alexander Pyhalov via oi-dev 
Отправлено: 31 июля 2019 г. 22:28
Кому: Alexander Pyhalov via oi-dev
Копия: Alexander Pyhalov
Тема: Re: [oi-dev] Clang and GCC6 runtime

No, -fopenmp seems to be implemented wrong.
_REENTRANT is not defined, libgomp is not linked.
If we specify "clang++  omp.cc -fopenmp=libgomp -o omp", application is linked, 
but pragma parallel uses just one thread.

When -pthreads is used, _REENTRANT is undefined.

-pthread seems to work as expected.

С уважением,
Александр Пыхалов,
программист отдела телекоммуникационной инфраструктуры
управления информационно-коммуникационной инфраструктуры ЮФУ



От: Bob Friesenhahn 
Отправлено: 31 июля 2019 г. 21:48
Кому: Alexander Pyhalov via oi-dev
Тема: Re: [oi-dev] Clang and GCC6 runtime

On Wed, 31 Jul 2019, Alexander Pyhalov via oi-dev wrote:

> OK
> I have almost working Clang 8.0.1.

Do the normal -pthreads and -fopenmp (OpenMP) options work with this
build?  I was excited when I found Clang 8 available from pkgsrc but
was disappointed when I found that GCC options normally available from
Solaris are not working.  It may be that Clang is lacking
customizations necessary to emulate GCC under Solaris-derived systems.

Bob
--
Bob Friesenhahn
bfrie...@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,http://www.GraphicsMagick.org/
Public Key, http://www.simplesystems.org/users/bfriesen/public-key.txt

___
oi-dev mailing list
oi-dev@openindiana.org
https://openindiana.org/mailman/listinfo/oi-dev

___
oi-dev mailing list
oi-dev@openindiana.org
https://openindiana.org/mailman/listinfo/oi-dev

___
oi-dev mailing list
oi-dev@openindiana.org
https://openindiana.org/mailman/listinfo/oi-dev


Re: [oi-dev] Clang and GCC6 runtime

2019-07-31 Thread Alexander Pyhalov via oi-dev
No, -fopenmp seems to be implemented wrong.
_REENTRANT is not defined, libgomp is not linked.
If we specify "clang++  omp.cc -fopenmp=libgomp -o omp", application is linked, 
but pragma parallel uses just one thread.

When -pthreads is used, _REENTRANT is undefined.

-pthread seems to work as expected.

С уважением,
Александр Пыхалов,
программист отдела телекоммуникационной инфраструктуры
управления информационно-коммуникационной инфраструктуры ЮФУ



От: Bob Friesenhahn 
Отправлено: 31 июля 2019 г. 21:48
Кому: Alexander Pyhalov via oi-dev
Тема: Re: [oi-dev] Clang and GCC6 runtime

On Wed, 31 Jul 2019, Alexander Pyhalov via oi-dev wrote:

> OK
> I have almost working Clang 8.0.1.

Do the normal -pthreads and -fopenmp (OpenMP) options work with this
build?  I was excited when I found Clang 8 available from pkgsrc but
was disappointed when I found that GCC options normally available from
Solaris are not working.  It may be that Clang is lacking
customizations necessary to emulate GCC under Solaris-derived systems.

Bob
--
Bob Friesenhahn
bfrie...@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,http://www.GraphicsMagick.org/
Public Key, http://www.simplesystems.org/users/bfriesen/public-key.txt

___
oi-dev mailing list
oi-dev@openindiana.org
https://openindiana.org/mailman/listinfo/oi-dev

___
oi-dev mailing list
oi-dev@openindiana.org
https://openindiana.org/mailman/listinfo/oi-dev


Re: [oi-dev] Clang and GCC6 runtime

2019-07-31 Thread Bob Friesenhahn

On Wed, 31 Jul 2019, Alexander Pyhalov via oi-dev wrote:


OK
I have almost working Clang 8.0.1.


Do the normal -pthreads and -fopenmp (OpenMP) options work with this 
build?  I was excited when I found Clang 8 available from pkgsrc but 
was disappointed when I found that GCC options normally available from 
Solaris are not working.  It may be that Clang is lacking 
customizations necessary to emulate GCC under Solaris-derived systems.


Bob
--
Bob Friesenhahn
bfrie...@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,http://www.GraphicsMagick.org/
Public Key, http://www.simplesystems.org/users/bfriesen/public-key.txt

___
oi-dev mailing list
oi-dev@openindiana.org
https://openindiana.org/mailman/listinfo/oi-dev


Re: [oi-dev] Clang and GCC6 runtime

2019-07-31 Thread Alexander Pyhalov via oi-dev
OK
I have almost working Clang 8.0.1.

The only issue, it doesn't include G++ runpaths in resulting binary. But 
(suddenly), resulting binaries seem to work with either runtime (GCC4 or 6)...

С уважением,
Александр Пыхалов,
программист отдела телекоммуникационной инфраструктуры
управления информационно-коммуникационной инфраструктуры ЮФУ



От: Aurélien Larcher 
Отправлено: 30 июля 2019 г. 18:40
Кому: Alexander Pyhalov
Тема: Re: Clang and GCC6 runtime

I also wonder what caused breakage of this component as I have used it for my 
research projects until last year, including compiled with gcc-8 in my build 
zone.

On Tue, Jul 30, 2019 at 4:36 PM Alexander Pyhalov 
mailto:a...@sfedu.ru>> wrote:
Hi.

I've looked at https://www.illumos.org/issues/11507, and first issue is clear, 
01-openindiana.patch needs fixing.

diff --git a/components/developer/clang-40/patches/01-openindiana.patch 
b/components/developer/clang-40/patches/01-openindiana.patch
index cf4548b7e..f18920444 100644
--- a/components/developer/clang-40/patches/01-openindiana.patch
+++ b/components/developer/clang-40/patches/01-openindiana.patch
@@ -65,15 +65,15 @@ diff -ruN 
llvm-4.0.0.src/tools/clang/lib/Driver/ToolChains.cpp 
llvm-4.0.0.src.pa
 +  std::string GCCVersion = OPENINDIANA_GCC_VERSION;
switch (Triple.getArch()) {
case llvm::Triple::x86:
-+GCCLibPath += ("i386-" + Triple.getVendorName() + "-" + 
Triple.getOSName()).str() + "/"+GCCVersion+"/";
++GCCLibPath += ("/i386-" + Triple.getVendorName() + "-" + 
Triple.getOSName()).str() + "/"+GCCVersion+"/";
case llvm::Triple::sparc:
  break;
case llvm::Triple::x86_64:
-+GCCLibPath += ("i386-" + Triple.getVendorName() + "-" + 
Triple.getOSName()).str() + "/"+GCCVersion+"/amd64";
++GCCLibPath += ("/i386-" + Triple.getVendorName() + "-" + 
Triple.getOSName()).str() + "/"+GCCVersion+"/amd64";
  LibPath += "amd64/";
  break;
case llvm::Triple::sparcv9:
-+GCCLibPath += ("sparc-" + Triple.getVendorName() + "-" + 
Triple.getOSName()).str() + "/"+GCCVersion+"/sparcv9";
++GCCLibPath += ("/sparc-" + Triple.getVendorName() + "-" + 
Triple.getOSName()).str() + "/"+GCCVersion+"/sparcv9";
  LibPath += "sparcv9/";
  break;
default:


The second issue is worse. After applying this patch I see the following issues 
with simple c++ programs:

clang++ 1.cc -o 1
(or  clang++ 1.cc -Wl,-L/usr/gcc/6/lib -Wl,-R/usr/gcc/6/lib -o 1), doesn't 
matter much.

$ ./1
Segmentation Fault (core dumped)
$ pstack core
core 'core' of 18083:   ./1
 feee60d2 _ZNSo6sentryC1ERSo (8047b48, 8061480, 200, 40) + 22
 feee67c8 
_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_i 
(8061480, 8051181, 1, 30) + 28
 feee6c22 _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc (8061480, 
8051181, 8047c1c, 805114f, 8061184, 8050e5e) + 32
 08051122 main (1, 8047c1c, 8047c24, 8050f52, 0, 0) + 32
 08050f77 _start_crt (1, 8047c1c, fefcfed4, 0, 0, 0) + 96
 08050e4a _start   (1, 8047d10, 0, 8047d14, 8047d28, 8047d41) + 1a


Do I understand correctly that it's issue with GCC C++ ABI and we either have 
to use GCC 4 runntime libraries for clang or update clang ?


С уважением,
Александр Пыхалов,
программист отдела телекоммуникационной инфраструктуры
управления информационно-коммуникационной инфраструктуры ЮФУ



--
---
Praise the Caffeine embeddings
___
oi-dev mailing list
oi-dev@openindiana.org
https://openindiana.org/mailman/listinfo/oi-dev