DevHeads.net

Can we use SCLs for building for EPEL 6?

So, the background is that I'd like to build zchunk for EPEL 6 (it's
already built for EPEL 7). Unfortunately, the gcc in EL6 is too old to
build zchunk, so I'd prefer to use a newer version from an SCL, rather
than rewrite zchunk to be compatible with an ancient version of gcc.

I noticed that SCLs are available for EPEL 7 (note the final repository
in the list at <a href="https://koji.fedoraproject.org/koji/taginfo?tagID=259" title="https://koji.fedoraproject.org/koji/taginfo?tagID=259">https://koji.fedoraproject.org/koji/taginfo?tagID=259</a>),
but not for EPEL 6 (see
<a href="https://koji.fedoraproject.org/koji/taginfo?tagID=140" title="https://koji.fedoraproject.org/koji/taginfo?tagID=140">https://koji.fedoraproject.org/koji/taginfo?tagID=140</a>).

So, is there any way we can use SCLs for building on EPEL 6, or should
I stop tilting at windmills and just say EL6 is too old for zchunk?

Jonathan

Comments

Re: Can we use SCLs for building for EPEL 6?

By John Reiser at 04/13/2019 - 16:11

In what specific way(s)? Can the complaints from gcc [which version?],
or other tools in the toolchain, be listed here?
Other developers may have faced the same or similar problems,
and may have tools to help.

Re: Can we use SCLs for building for EPEL 6?

By Jonathan Dieter at 04/13/2019 - 16:36

On Sat, 2019-04-13 at 13:11 -0700, John Reiser wrote:
Sorry, I should have shared that the first time around.

The version of gcc that comes with EL6 is 4.4.7.

When building zchunk, I get a number of messages that look like:
$ ninja-build
[1/178] Compiling C object 'src/lib/zck@sha/comp_zstd_zstd.c.o'.
FAILED: src/lib/zck@sha/comp_zstd_zstd.c.o
cc -Isrc/lib/zck@sha -Isrc/lib -I../src/lib -Iinclude -I../include -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -O0 -g -DZCHUNK_ZSTD -DZCHUNK_OPENSSL -fvisibility=hidden -fPIC -MMD -MQ 'src/lib/zck@sha/comp_zstd_zstd.c.o' -MF 'src/lib/zck@sha/comp_zstd_zstd.c.o.d' -o 'src/lib/zck@sha/comp_zstd_zstd.c.o' -c ../src/lib/comp/zstd/zstd.c
In file included from ../src/lib/comp/zstd/zstd.c:34:
../src/lib/zck_private.h:92: error: redefinition of typedef 'zckCtx'
include/zck.h:49: note: previous declaration of 'zckCtx' was here
../src/lib/zck_private.h:106: error: redefinition of typedef 'zck_log_type'
include/zck.h:47: note: previous declaration of 'zck_log_type' was here
../src/lib/zck_private.h:117: error: redefinition of typedef 'zckHash'
include/zck.h:50: note: previous declaration of 'zckHash' was here
../src/lib/zck_private.h:150: error: redefinition of typedef 'zckDL'
include/zck.h:54: note: previous declaration of 'zckDL' was here
../src/lib/zck_private.h:165: error: redefinition of typedef 'zckChunk'
include/zck.h:51: note: previous declaration of 'zckChunk' was here
../src/lib/zck_private.h:177: error: redefinition of typedef 'zckIndex'
include/zck.h:52: note: previous declaration of 'zckIndex' was here
../src/lib/zck_private.h:193: error: redefinition of typedef 'zckRange'
include/zck.h:53: note: previous declaration of 'zckRange' was here
../src/lib/zck_private.h:224: error: redefinition of typedef 'zckComp'
../src/lib/zck_private.h:91: note: previous declaration of 'zckComp' was here
../src/lib/zck_private.h:298: error: redefinition of typedef 'zckCtx'
../src/lib/zck_private.h:92: note: previous declaration of 'zckCtx' was here

For reference, you can find zck.h.in (which gets processed into zck.h
with the version added) at:
<a href="https://github.com/zchunk/zchunk/blob/master/include/zck.h.in" title="https://github.com/zchunk/zchunk/blob/master/include/zck.h.in">https://github.com/zchunk/zchunk/blob/master/include/zck.h.in</a>

and zck_private.h at:
<a href="https://github.com/zchunk/zchunk/blob/master/src/lib/zck_private.h" title="https://github.com/zchunk/zchunk/blob/master/src/lib/zck_private.h">https://github.com/zchunk/zchunk/blob/master/src/lib/zck_private.h</a>

As far as I can see, gcc-4.7 doesn't like that I'm typedefing the same
struct to the same type twice. Later versions don't see it as a
problem at all.

(Just to be clear, this still happens if I change zck_private.h to say:
typedef struct zckCtx zckCtx;)

Jonathan