Backport #7470

ruby 1.9.3-p327 compile failure in siphash.c on Solaris because of endian.h

Added by Tim Mooney over 1 year ago. Updated over 1 year ago.

[ruby-core:50343]
Status:Closed
Priority:Normal
Assignee:Usaku NAKAMURA

Description

I had previously built ruby 1.9.3-p194 on x86_64-sun-solaris2.10 with the no-cost Oracle WorkShop compilers:

$ cc -V
cc: Sun C 5.12 SunOS_i386 2011/11/16

However, when I attempt to build ruby-1.9.3-p327, I get a compilation failure in siphash.c, because it's including a header file (endian.h) that appears to be specific to Linux:

cc -m64 -Xa -xc99=all -xO0 -g -xs -xstrconst -mt -xtarget=native -xarch=native -I/local/include -I/local/gnu/include -I/local/openssl/include -m64 -DRUBYEXPORT -I/local/include -I/local/gnu/include -I/local/openssl/include -I. -I.ext/include/x8664-solaris2.10 -I./include -I. -o random.o -c random.c
"siphash.c", line 11: cannot find include file:
cc: acomp failed for random.c
gmake: *** [random.o] Error 2

Solaris doesn't include that header, instead it uses sys/byteorder.h.

The attached patch appears to fix the issue for me.

ruby-1.9.3-p327-solaris-siphash.c.patch Magnifier - fix siphash.c endian code for Solaris (592 Bytes) Tim Mooney, 11/30/2012 07:56 AM


Related issues

Duplicates Backport93 - Backport #7347: 1.9.3p327 Build fails on Solaris 10 SPARC due to missing ... Closed 11/13/2012
Duplicated by ruby-trunk - Bug #7569: siphash.c / endian.h Closed 12/16/2012

History

#1 Updated by Shyouhei Urabe over 1 year ago

  • Status changed from Open to Assigned
  • Assignee set to Nobuyoshi Nakada

Nobu? Can you look at it?

#2 Updated by Nobuyoshi Nakada over 1 year ago

  • Tracker changed from Bug to Backport
  • Project changed from ruby-trunk to Backport93
  • Category deleted (build)
  • Assignee changed from Nobuyoshi Nakada to Usaku NAKAMURA
  • Target version deleted (1.9.3)

backport r37593.

#3 Updated by Usaku NAKAMURA over 1 year ago

  • Status changed from Assigned to Closed

It's already fixed on the repository, but not released yet.
Check out r37593 or later from ruby19_3 branch, or simply
patch the revision by hand, please.

IMO the simplest way is downloading random.c of the revision
and replace the file in p327 package.

Resource:
http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_3/random.c

Also available in: Atom PDF