omniti-labs / omnios-build

Build system for OmniOS - Note, this is a quasi-private archive for OmniTI, you probably want https://omniosce.org
Other
39 stars 136 forks source link

gcc doesn't cope with newly built openssl on r151014 #85

Open lotheac opened 8 years ago

lotheac commented 8 years ago
% cpp -include openssl/opensslconf.h -xc <<EOF
#ifndef OPENSSL_NO_MD2
#include <openssl/md2.h>
#endif
EOF
#1 "<stdin>"
#1 "<command-line>"
#1 "/opt/gcc-4.8.1/lib/gcc/i386-pc-solaris2.11/4.8.1/include-fixed/openssl/opensslconf.h" 1 3 4
#1 "<command-line>" 2
#1 "<stdin>"
<stdin>:2:25: fatal error: openssl/md2.h: No such file or directory
compilation terminated.

OPENSSL_NO_MD2 is defined in openssl/opensslconf.h, but gcc "fixes" that header at build time by copying it to its 'include-fixed' directory (shown in cpp output above).

% diff /opt/gcc-4.8.1/lib/gcc/i386-pc-solaris2.11/4.8.1/include-fixed/openssl/opensslconf.h /usr/include/openssl/opensslconf.h
1,9d0
< /*  DO NOT EDIT THIS FILE.
< 
<     It has been auto-edited by fixincludes from:
< 
<       "/usr/include/openssl/opensslconf.h"
< 
<     This had to be done to correct non-standard usages in the
<     original, manufacturer supplied header file.  */
< 
34a26,28
> #ifndef OPENSSL_NO_MD2
> # define OPENSSL_NO_MD2
> #endif
52a47,49
> #ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
> # define OPENSSL_NO_WEAK_SSL_CIPHERS
> #endif
82a80,82
> # if defined(OPENSSL_NO_MD2) && !defined(NO_MD2)
> #  define NO_MD2
> # endif
100a101,103
> # if defined(OPENSSL_NO_WEAK_SSL_CIPHERS) && !defined(NO_WEAK_SSL_CIPHERS)
> #  define NO_WEAK_SSL_CIPHERS
> # endif
208c211
< YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!

---
> #error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
227c230
< #if defined( __sun__ )                /* Newer Sparc's */

---
> #if defined( __sun ) || defined ( sun )               /* Newer Sparc's */

So effectively this means that gcc needs to be rebuilt if openssl configuration changes. Although you could probably patch opensslconf.h instead to make gcc's fixincludes not fix it.

In any case, this means that a fully updated 151014 box cannot build eg. perl Net::SSLeay. A republished gcc package is required to fix that (either to update the include-fixed header or to make it not end up there in the first place).

Also interesting to note that there are 18 header files in that include-fixed path on my 151014 box, whereas gcc-4.4.4's path only contains two...

danmcd commented 8 years ago

Thanks a lot GCC... I wonder if this affects r151016 as well?

lotheac commented 8 years ago

On Tue, Apr 12 2016 06:47:19 -0700, Dan McDonald wrote:

Thanks a lot GCC... I wonder if this affects r151016 as well?

Yep, and bloody too.

Lauri Tirkkonen | lotheac @ IRCnet

lotheac commented 8 years ago

On Tue, Apr 12 2016 17:07:08 +0300, Lauri Tirkkonen wrote:

On Tue, Apr 12 2016 06:47:19 -0700, Dan McDonald wrote:

Thanks a lot GCC... I wonder if this affects r151016 as well?

Yep, and bloody too.

I'll rephrase: the header exists in include-fixed on r151016 and bloody, but only r151016 is actually broken (because its opensslconf.h has changed after its gcc package was last built).

Lauri Tirkkonen | lotheac @ IRCnet

danmcd commented 8 years ago

Fixed.

danmcd-ol(~)[4]% sudo pkg update -nv
            Packages to update:         1
     Estimated space available:  18.19 GB
Estimated space to be consumed: 643.32 MB
       Create boot environment:        No
Create backup boot environment:       Yes
          Rebuild boot archive:        No

Changed packages:
omnios
  developer/gcc48
    4.8.1-0.151014:20150402T205830Z -> 4.8.1-0.151014:20160516T163714Z
danmcd-ol(~)[0]% source gcc-test
# 1 "<stdin>"
# 1 "<command-line>"
# 1 "/opt/gcc-4.8.1/lib/gcc/i386-pc-solaris2.11/4.8.1/include-fixed/openssl/opensslconf.h" 1 3 4
# 1 "<command-line>" 2
# 1 "<stdin>"
<stdin>:2:25: fatal error: openssl/md2.h: No such file or directory
compilation terminated.
danmcd-ol(~)[1]% sudo pkg update
            Packages to update:   1
       Create boot environment:  No
Create backup boot environment: Yes

DOWNLOAD                                PKGS         FILES    XFER (MB)   SPEED
Completed                                1/1         74/74  139.4/139.4  6.7M/s

PHASE                                          ITEMS
Removing old actions                             1/1
Installing new actions                           2/2
Updating modified actions                      88/88
Updating package state database                 Done 
Updating package cache                           1/1 
Updating image state                            Done 
Creating fast lookup database                   Done 

---------------------------------------------------------------------------
NOTE: Please review release notes posted at:

http://omnios.omniti.com/ReleaseNotes
---------------------------------------------------------------------------

danmcd-ol(~)[0]% source gcc-test
# 1 "<stdin>"
# 1 "<command-line>"
# 1 "/opt/gcc-4.8.1/lib/gcc/i386-pc-solaris2.11/4.8.1/include-fixed/openssl/opensslconf.h" 1 3 4
# 1 "<command-line>" 2
# 1 "<stdin>"
danmcd-ol(~)[0]% 
danmcd commented 8 years ago

Per the original filer, I'm keeping this open --> like the illumos-building gcc44, gcc51 (or any of its replacements) shouldn't included extra header files like this.