[openssl.org #4642] [openssl-1.1.0-pre6] make failes with solaris-x86-cc & solaris64-x86_64-cc

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[openssl.org #4642] [openssl-1.1.0-pre6] make failes with solaris-x86-cc & solaris64-x86_64-cc

Rich Salz via RT
To only allow the use of __atomic_add_fetch when __ATOMIC_RELAXED is non-zero
isn't the right move here. So it seems that different compilers either only
implement a subset of the __atomic builtins, or name them differently.

What was the macro defined by the DeveloperStudio compiler? __SUNPRO_C or
something else? In that case, the correct method might be to exclude it, like
this:

#if defined(__ATOMIC_RELAXED) && !defined(__SUNPRO_C)

On Mon Aug 08 08:33:34 2016, [hidden email] wrote:

> Hello,
>
> % ./Configure solaris-x86-cc
> % make
> :
> Undefined first referenced
> symbol in file
> __atomic_add_fetch ./libcrypto.so
> ld: fatal: symbol referencing errors. No output written to
> fuzz/asn1parse-test
>
>
> % ./Configure solaris64-x86_64-cc
> % make
> has the same error.
>
> Tested on Solaris10 x86/64, with Solaris developerstudio12.5.
>
>
> This is caused because __ATOMIC_RELAXED is #defined as 0
> in /opt/developerstudio12.5/lib/compilers/include/CC/gnu/builtins.h
>
>
> Sample patch:
> --- ../openssl-1.1.0-pre6.orig/crypto/threads_pthread.c
> +++ ./crypto/threads_pthread.c
> @@ -109,7 +109,7 @@
>
> int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK
> *lock)
> {
> -#ifdef __ATOMIC_RELAXED
> +#if __ATOMIC_RELAXED
> *ret = __atomic_add_fetch(val, amount, __ATOMIC_RELAXED);
> #else
> if (!CRYPTO_THREAD_write_lock(lock))
>
>
> With this patch,
> % ./Configure solaris-x86-cc
> % make
> % make test
> passes.
>
> % ./Configure solaris64-x86_64-cc
> % make
> passes but
> % make test
> stops.
> This is another problem, which seems to be the same as bug #4641.
>
>
> Regards,
>
> --- Kiyoshi <[hidden email]>


--
Richard Levitte
[hidden email]

--
Ticket here: http://rt.openssl.org/Ticket/Display.html?id=4642
Please log in as guest with password guest if prompted

--
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev
Reply | Threaded
Open this post in threaded view
|

Re: [openssl.org #4642] [openssl-1.1.0-pre6] make failes with solaris-x86-cc & solaris64-x86_64-cc

Erik Forsberg-11
as __atomic_* is non-standard, I propose guarding with __GNUC__
The C11 standard names are atomic_*
Would be nice if they could be supported ?

>-- Original Message --
>
>To only allow the use of __atomic_add_fetch when __ATOMIC_RELAXED is non-zero
>isn't the right move here. So it seems that different compilers either only
>implement a subset of the __atomic builtins, or name them differently.
>
>What was the macro defined by the DeveloperStudio compiler? __SUNPRO_C or
>something else? In that case, the correct method might be to exclude it, like
>this:
>
>#if defined(__ATOMIC_RELAXED) && !defined(__SUNPRO_C)
>
>On Mon Aug 08 08:33:34 2016, [hidden email] wrote:
>> Hello,
>>
>> % ./Configure solaris-x86-cc
>> % make
>> :
>> Undefined first referenced
>> symbol in file
>> __atomic_add_fetch ./libcrypto.so
>> ld: fatal: symbol referencing errors. No output written to
>> fuzz/asn1parse-test
>>
>>
>> % ./Configure solaris64-x86_64-cc
>> % make
>> has the same error.
>>
>> Tested on Solaris10 x86/64, with Solaris developerstudio12.5.
>>
>>
>> This is caused because __ATOMIC_RELAXED is #defined as 0
>> in /opt/developerstudio12.5/lib/compilers/include/CC/gnu/builtins.h
>>
>>
>> Sample patch:
>> --- ../openssl-1.1.0-pre6.orig/crypto/threads_pthread.c
>> +++ ./crypto/threads_pthread.c
>> @@ -109,7 +109,7 @@
>>
>> int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK
>> *lock)
>> {
>> -#ifdef __ATOMIC_RELAXED
>> +#if __ATOMIC_RELAXED
>> *ret = __atomic_add_fetch(val, amount, __ATOMIC_RELAXED);
>> #else
>> if (!CRYPTO_THREAD_write_lock(lock))
>>
>>
>> With this patch,
>> % ./Configure solaris-x86-cc
>> % make
>> % make test
>> passes.
>>
>> % ./Configure solaris64-x86_64-cc
>> % make
>> passes but
>> % make test
>> stops.
>> This is another problem, which seems to be the same as bug #4641.
>>
>>
>> Regards,
>>
>> --- Kiyoshi <[hidden email]>
>
>
>--
>Richard Levitte
>[hidden email]
>
>--
>Ticket here: http://rt.openssl.org/Ticket/Display.html?id=4642
>Please log in as guest with password guest if prompted
>
>--
>openssl-dev mailing list
>To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev

--
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev
Reply | Threaded
Open this post in threaded view
|

Re: [openssl.org #4642] [openssl-1.1.0-pre6] make failes with solaris-x86-cc & solaris64-x86_64-cc

Rich Salz via RT
In reply to this post by Rich Salz via RT
Yes, __SUNPRO_C is defined by DeveloperStudio compiler.

> To only allow the use of __atomic_add_fetch when __ATOMIC_RELAXED is non-zero

> isn't the right move here. So it seems that different compilers either only
> implement a subset of the __atomic builtins, or name them differently.
>
> What was the macro defined by the DeveloperStudio compiler? __SUNPRO_C or
> something else? In that case, the correct method might be to exclude it, like
> this:
>
> #if defined(__ATOMIC_RELAXED) && !defined(__SUNPRO_C)
>
> On Mon Aug 08 08:33:34 2016, [hidden email] wrote:
>>  Hello,
>>
>>  % ./Configure solaris-x86-cc
>>  % make
>>  :
>>  Undefined first referenced
>>  symbol in file
>>  __atomic_add_fetch ./libcrypto.so
>>  ld: fatal: symbol referencing errors. No output written to
>>  fuzz/asn1parse-test
>>
>>
>>  % ./Configure solaris64-x86_64-cc
>>  % make
>>  has the same error.
>>
>>  Tested on Solaris10 x86/64, with Solaris developerstudio12.5.
>>
>>
>>  This is caused because __ATOMIC_RELAXED is #defined as 0
>>  in /opt/developerstudio12.5/lib/compilers/include/CC/gnu/builtins.h
>>
>>
>>  Sample patch:
>>  --- ../openssl-1.1.0-pre6.orig/crypto/threads_pthread.c
>>  +++ ./crypto/threads_pthread.c
>>  @@ -109,7 +109,7 @@
>>
>>  int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK
>>  *lock)
>>  {
>>  -#ifdef __ATOMIC_RELAXED
>>  +#if __ATOMIC_RELAXED
>>  *ret = __atomic_add_fetch(val, amount, __ATOMIC_RELAXED);
>>  #else
>>  if (!CRYPTO_THREAD_write_lock(lock))
>>
>>
>>  With this patch,
>>  % ./Configure solaris-x86-cc
>>  % make
>>  % make test
>>  passes.
>>
>>  % ./Configure solaris64-x86_64-cc
>>  % make
>>  passes but
>>  % make test
>>  stops.
>>  This is another problem, which seems to be the same as bug #4641.
>>
>>
>>  Regards,
>>
>>  --- Kiyoshi <[hidden email]>
>
>
> --
> Richard Levitte
> [hidden email]
>
> --
> Ticket here: http://rt.openssl.org/Ticket/Display.html?id=4642
> Please log in as guest with password guest if prompted
>


--
Ticket here: http://rt.openssl.org/Ticket/Display.html?id=4642
Please log in as guest with password guest if prompted

--
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev
Reply | Threaded
Open this post in threaded view
|

[openssl.org #4642] [openssl-1.1.0-pre6] make failes with solaris-x86-cc & solaris64-x86_64-cc

Rich Salz via RT
In reply to this post by Rich Salz via RT
Ok. I'm going with that solution, then. See attached diff.

Cheers,
Richard

On Wed Aug 17 21:21:34 2016, [hidden email] wrote:

> Yes, __SUNPRO_C is defined by DeveloperStudio compiler.
>
> > To only allow the use of __atomic_add_fetch when __ATOMIC_RELAXED is
> > non-zero
>
> > isn't the right move here. So it seems that different compilers
> > either only
> > implement a subset of the __atomic builtins, or name them
> > differently.
> >
> > What was the macro defined by the DeveloperStudio compiler?
> > __SUNPRO_C or
> > something else? In that case, the correct method might be to exclude
> > it, like
> > this:
> >
> > #if defined(__ATOMIC_RELAXED) && !defined(__SUNPRO_C)
> >
> > On Mon Aug 08 08:33:34 2016, [hidden email] wrote:
> >> Hello,
> >>
> >> % ./Configure solaris-x86-cc
> >> % make
> >> :
> >> Undefined first referenced
> >> symbol in file
> >> __atomic_add_fetch ./libcrypto.so
> >> ld: fatal: symbol referencing errors. No output written to
> >> fuzz/asn1parse-test
> >>
> >>
> >> % ./Configure solaris64-x86_64-cc
> >> % make
> >> has the same error.
> >>
> >> Tested on Solaris10 x86/64, with Solaris developerstudio12.5.
> >>
> >>
> >> This is caused because __ATOMIC_RELAXED is #defined as 0
> >> in /opt/developerstudio12.5/lib/compilers/include/CC/gnu/builtins.h
> >>
> >>
> >> Sample patch:
> >> --- ../openssl-1.1.0-pre6.orig/crypto/threads_pthread.c
> >> +++ ./crypto/threads_pthread.c
> >> @@ -109,7 +109,7 @@
> >>
> >> int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK
> >> *lock)
> >> {
> >> -#ifdef __ATOMIC_RELAXED
> >> +#if __ATOMIC_RELAXED
> >> *ret = __atomic_add_fetch(val, amount, __ATOMIC_RELAXED);
> >> #else
> >> if (!CRYPTO_THREAD_write_lock(lock))
> >>
> >>
> >> With this patch,
> >> % ./Configure solaris-x86-cc
> >> % make
> >> % make test
> >> passes.
> >>
> >> % ./Configure solaris64-x86_64-cc
> >> % make
> >> passes but
> >> % make test
> >> stops.
> >> This is another problem, which seems to be the same as bug #4641.
> >>
> >>
> >> Regards,
> >>
> >> --- Kiyoshi <[hidden email]>
> >
> >
> > --
> > Richard Levitte
> > [hidden email]
> >
> > --
> > Ticket here: http://rt.openssl.org/Ticket/Display.html?id=4642
> > Please log in as guest with password guest if prompted
> >

--
Richard Levitte
[hidden email]

--
Ticket here: http://rt.openssl.org/Ticket/Display.html?id=4642
Please log in as guest with password guest if prompted


commit 7a73fd48ee58b7792b7c89526c7d3c650091559e
Author: Richard Levitte <[hidden email]>
Date:   Tue Aug 23 03:41:46 2016 -0700

    Don't use __atomic_add_fetch with DeveloperStudio on Solaris
   
    It seems that, although __ATOMIC_RELAXED is defined, that function
    isn't necessarely present.
   
    RT#4642

diff --git a/crypto/threads_pthread.c b/crypto/threads_pthread.c
index 6f5e812..87a2cd6 100644
--- a/crypto/threads_pthread.c
+++ b/crypto/threads_pthread.c
@@ -109,7 +109,7 @@ int CRYPTO_THREAD_compare_id(CRYPTO_THREAD_ID a, CRYPTO_THREAD_ID b)
 
 int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock)
 {
-#ifdef __ATOMIC_RELAXED
+#if defined(__ATOMIC_RELAXED) && !defined(__SUNPRO_C)
     *ret = __atomic_add_fetch(val, amount, __ATOMIC_RELAXED);
 #else
     if (!CRYPTO_THREAD_write_lock(lock))

--
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev
Reply | Threaded
Open this post in threaded view
|

[openssl.org #4642] [openssl-1.1.0-pre6] make failes with solaris-x86-cc & solaris64-x86_64-cc

Rich Salz via RT
In reply to this post by Rich Salz via RT
After much internal deliberation, we ended up checking __GNUC__ rather than
dissing __SUBPRO_C. Our hope is that a compiler that implements GNU extensions
will also define __GNUC__. Our checks of the Intel compiler (which someone
referred to) does so, for example (if I understood correctly).

https://github.com/openssl/openssl/pull/1484

Cheers,
Richard

On Tue Aug 23 10:48:46 2016, levitte wrote:

> Ok. I'm going with that solution, then. See attached diff.
>
> Cheers,
> Richard
>
> On Wed Aug 17 21:21:34 2016, [hidden email] wrote:
> > Yes, __SUNPRO_C is defined by DeveloperStudio compiler.
> >
> > > To only allow the use of __atomic_add_fetch when __ATOMIC_RELAXED is
> > > non-zero
> >
> > > isn't the right move here. So it seems that different compilers
> > > either only
> > > implement a subset of the __atomic builtins, or name them
> > > differently.
> > >
> > > What was the macro defined by the DeveloperStudio compiler?
> > > __SUNPRO_C or
> > > something else? In that case, the correct method might be to exclude
> > > it, like
> > > this:
> > >
> > > #if defined(__ATOMIC_RELAXED) && !defined(__SUNPRO_C)
> > >
> > > On Mon Aug 08 08:33:34 2016, [hidden email] wrote:
> > >> Hello,
> > >>
> > >> % ./Configure solaris-x86-cc
> > >> % make
> > >> :
> > >> Undefined first referenced
> > >> symbol in file
> > >> __atomic_add_fetch ./libcrypto.so
> > >> ld: fatal: symbol referencing errors. No output written to
> > >> fuzz/asn1parse-test
> > >>
> > >>
> > >> % ./Configure solaris64-x86_64-cc
> > >> % make
> > >> has the same error.
> > >>
> > >> Tested on Solaris10 x86/64, with Solaris developerstudio12.5.
> > >>
> > >>
> > >> This is caused because __ATOMIC_RELAXED is #defined as 0
> > >> in /opt/developerstudio12.5/lib/compilers/include/CC/gnu/builtins.h
> > >>
> > >>
> > >> Sample patch:
> > >> --- ../openssl-1.1.0-pre6.orig/crypto/threads_pthread.c
> > >> +++ ./crypto/threads_pthread.c
> > >> @@ -109,7 +109,7 @@
> > >>
> > >> int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK
> > >> *lock)
> > >> {
> > >> -#ifdef __ATOMIC_RELAXED
> > >> +#if __ATOMIC_RELAXED
> > >> *ret = __atomic_add_fetch(val, amount, __ATOMIC_RELAXED);
> > >> #else
> > >> if (!CRYPTO_THREAD_write_lock(lock))
> > >>
> > >>
> > >> With this patch,
> > >> % ./Configure solaris-x86-cc
> > >> % make
> > >> % make test
> > >> passes.
> > >>
> > >> % ./Configure solaris64-x86_64-cc
> > >> % make
> > >> passes but
> > >> % make test
> > >> stops.
> > >> This is another problem, which seems to be the same as bug #4641.
> > >>
> > >>
> > >> Regards,
> > >>
> > >> --- Kiyoshi <[hidden email]>
> > >
> > >
> > > --
> > > Richard Levitte
> > > [hidden email]
> > >
> > > --
> > > Ticket here: http://rt.openssl.org/Ticket/Display.html?id=4642
> > > Please log in as guest with password guest if prompted
> > >
>
>
> --
> Richard Levitte
> [hidden email]


--
Richard Levitte
[hidden email]

--
Ticket here: http://rt.openssl.org/Ticket/Display.html?id=4642
Please log in as guest with password guest if prompted

--
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev
Reply | Threaded
Open this post in threaded view
|

[openssl.org #4642] [openssl-1.1.0-pre6] make failes with solaris-x86-cc & solaris64-x86_64-cc

Rich Salz via RT
In reply to this post by Rich Salz via RT
This has now been merged into the master branch, and will be part of version
1.1.0.

Cheers,
Richard ( closing ticket )

On Wed Aug 24 11:32:54 2016, levitte wrote:

> After much internal deliberation, we ended up checking __GNUC__ rather
> than
> dissing __SUBPRO_C. Our hope is that a compiler that implements GNU
> extensions
> will also define __GNUC__. Our checks of the Intel compiler (which
> someone
> referred to) does so, for example (if I understood correctly).
>
> https://github.com/openssl/openssl/pull/1484
>
> Cheers,
> Richard
>
> On Tue Aug 23 10:48:46 2016, levitte wrote:
> > Ok. I'm going with that solution, then. See attached diff.
> >
> > Cheers,
> > Richard
> >
> > On Wed Aug 17 21:21:34 2016, [hidden email] wrote:
> > > Yes, __SUNPRO_C is defined by DeveloperStudio compiler.
> > >
> > > > To only allow the use of __atomic_add_fetch when __ATOMIC_RELAXED
> > > > is
> > > > non-zero
> > >
> > > > isn't the right move here. So it seems that different compilers
> > > > either only
> > > > implement a subset of the __atomic builtins, or name them
> > > > differently.
> > > >
> > > > What was the macro defined by the DeveloperStudio compiler?
> > > > __SUNPRO_C or
> > > > something else? In that case, the correct method might be to
> > > > exclude
> > > > it, like
> > > > this:
> > > >
> > > > #if defined(__ATOMIC_RELAXED) && !defined(__SUNPRO_C)
> > > >
> > > > On Mon Aug 08 08:33:34 2016, [hidden email] wrote:
> > > >> Hello,
> > > >>
> > > >> % ./Configure solaris-x86-cc
> > > >> % make
> > > >> :
> > > >> Undefined first referenced
> > > >> symbol in file
> > > >> __atomic_add_fetch ./libcrypto.so
> > > >> ld: fatal: symbol referencing errors. No output written to
> > > >> fuzz/asn1parse-test
> > > >>
> > > >>
> > > >> % ./Configure solaris64-x86_64-cc
> > > >> % make
> > > >> has the same error.
> > > >>
> > > >> Tested on Solaris10 x86/64, with Solaris developerstudio12.5.
> > > >>
> > > >>
> > > >> This is caused because __ATOMIC_RELAXED is #defined as 0
> > > >> in
> > > >> /opt/developerstudio12.5/lib/compilers/include/CC/gnu/builtins.h
> > > >>
> > > >>
> > > >> Sample patch:
> > > >> --- ../openssl-1.1.0-pre6.orig/crypto/threads_pthread.c
> > > >> +++ ./crypto/threads_pthread.c
> > > >> @@ -109,7 +109,7 @@
> > > >>
> > > >> int CRYPTO_atomic_add(int *val, int amount, int *ret,
> > > >> CRYPTO_RWLOCK
> > > >> *lock)
> > > >> {
> > > >> -#ifdef __ATOMIC_RELAXED
> > > >> +#if __ATOMIC_RELAXED
> > > >> *ret = __atomic_add_fetch(val, amount, __ATOMIC_RELAXED);
> > > >> #else
> > > >> if (!CRYPTO_THREAD_write_lock(lock))
> > > >>
> > > >>
> > > >> With this patch,
> > > >> % ./Configure solaris-x86-cc
> > > >> % make
> > > >> % make test
> > > >> passes.
> > > >>
> > > >> % ./Configure solaris64-x86_64-cc
> > > >> % make
> > > >> passes but
> > > >> % make test
> > > >> stops.
> > > >> This is another problem, which seems to be the same as bug
> > > >> #4641.
> > > >>
> > > >>
> > > >> Regards,
> > > >>
> > > >> --- Kiyoshi <[hidden email]>
> > > >
> > > >
> > > > --
> > > > Richard Levitte
> > > > [hidden email]
> > > >
> > > > --
> > > > Ticket here: http://rt.openssl.org/Ticket/Display.html?id=4642
> > > > Please log in as guest with password guest if prompted
> > > >
> >
> >
> > --
> > Richard Levitte
> > [hidden email]
>
>
> --
> Richard Levitte
> [hidden email]


--
Richard Levitte
[hidden email]

--
Ticket here: http://rt.openssl.org/Ticket/Display.html?id=4642
Please log in as guest with password guest if prompted

--
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev