humbi83 / lz4

Automatically exported from code.google.com/p/lz4
0 stars 0 forks source link

Does not compile on Solaris. #38

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Download code, gmake

What is the expected output? What do you see instead?
Successful compile.

In file included from bench.c:50:0:
/usr/include/stdio.h:333:29: error: unknown type name 'off64_t'
/usr/include/stdio.h:334:1: error: unknown type name 'off64_t'

Fixed by removing the #define _LARGEFILE64_SOURCE line (line 33)
Could maybe replace with
#ifndef __LP64__
#ifdef __sun__
#define _LARGEFILE_SOURCE 
#define FILE_OFFSET_BITS=64
#else
#define _LARGEFILE64_SOURCE 
#endif
#endif

Or better move it into the makefile with with a `getconf LFS_CFLAGS` on the 
compile line.

Original issue reported on code.google.com by thwill...@gmail.com on 7 Oct 2012 at 2:18

GoogleCodeExporter commented 8 years ago
Thanks for reporting. I'll look into it.

Original comment by yann.col...@gmail.com on 8 Oct 2012 at 2:45

GoogleCodeExporter commented 8 years ago
My understanding is that the problem is a consequence of lz4demo.c.
One of the curious things to be noticed in your report is that the compilation 
error seems to locate the problem within <stdio.h>. 
How come ?

Regarding 'getconf' suggestion :
The lz4 source files are typically integrated into other projects, with their 
own builder/linker. 
Therefore, makefile dependant compilation parameters are avoided when possible.
A "self-sufficient" source file is preferable, using #define whenever necessary.

Original comment by yann.col...@gmail.com on 26 Oct 2012 at 11:30

GoogleCodeExporter commented 8 years ago
I'm interested in your suggestion with #define.
It seems __sun__ must be defined, but not __LP64__.
Does that mean the problem appears on Sun Solaris 32 bits, but not on 64 bits ?

Original comment by yann.col...@gmail.com on 27 Oct 2012 at 6:30

GoogleCodeExporter commented 8 years ago
The following attached file
is expected to solve the reported issue.

If that is possible, it would be good to test it on both Solaris 32 & 64 bits,
since it seems the problem is different for both versions.

Regards

Original comment by yann.col...@gmail.com on 29 Oct 2012 at 11:09

Attachments:

GoogleCodeExporter commented 8 years ago
Corrected into r82.

Original comment by yann.col...@gmail.com on 3 Nov 2012 at 9:06