Unable to compile GCC 8.2.0 from source

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello

I'm trying to build GCC 8.2.0 from source in order to provide a package to use on a Synology NAS (https://github.com/SynoCommunity/spksrc/), since it doesn't ship with a C compiler, however the compilation fails with this error:

../../libiberty/obstack.c: In function ‘call_chunkfun’:
../../libiberty/obstack.c:92:23: error: request for member ‘extra’ in something not a structure or union
     return h->chunkfun.extra (h->extra_arg, size);
                       ^
../../libiberty/obstack.c:94:23: error: request for member ‘plain’ in something not a structure or union
     return h->chunkfun.plain (size);
                       ^
../../libiberty/obstack.c: In function ‘call_freefun’:
../../libiberty/obstack.c:101:15: error: request for member ‘extra’ in something not a structure or union
     h->freefun.extra (h->extra_arg, old_chunk);
               ^
../../libiberty/obstack.c:103:15: error: request for member ‘plain’ in something not a structure or union
     h->freefun.plain (old_chunk);
               ^
../../libiberty/obstack.c: At top level:
../../libiberty/obstack.c:115:24: error: unknown type name ‘_OBSTACK_SIZE_T’
                        _OBSTACK_SIZE_T size, _OBSTACK_SIZE_T alignment)
                        ^~~~~~~~~~~~~~~
../../libiberty/obstack.c:115:46: error: unknown type name ‘_OBSTACK_SIZE_T’
                        _OBSTACK_SIZE_T size, _OBSTACK_SIZE_T alignment)
                                              ^~~~~~~~~~~~~~~
../../libiberty/obstack.c:157:17: error: unknown type name ‘_OBSTACK_SIZE_T’
                 _OBSTACK_SIZE_T size, _OBSTACK_SIZE_T alignment,
                 ^~~~~~~~~~~~~~~
../../libiberty/obstack.c:157:39: error: unknown type name ‘_OBSTACK_SIZE_T’
                 _OBSTACK_SIZE_T size, _OBSTACK_SIZE_T alignment,
                                       ^~~~~~~~~~~~~~~
../../libiberty/obstack.c:169:19: error: unknown type name ‘_OBSTACK_SIZE_T’
                   _OBSTACK_SIZE_T size, _OBSTACK_SIZE_T alignment,
                   ^~~~~~~~~~~~~~~
../../libiberty/obstack.c:169:41: error: unknown type name ‘_OBSTACK_SIZE_T’
                   _OBSTACK_SIZE_T size, _OBSTACK_SIZE_T alignment,
                                         ^~~~~~~~~~~~~~~
../../libiberty/obstack.c:188:39: error: unknown type name ‘_OBSTACK_SIZE_T’
 _obstack_newchunk (struct obstack *h, _OBSTACK_SIZE_T length)
                                       ^~~~~~~~~~~~~~~
../../libiberty/obstack.c:297:1: error: unknown type name ‘_OBSTACK_SIZE_T’
 _OBSTACK_SIZE_T
 ^~~~~~~~~~~~~~~
../../libiberty/obstack.c: In function ‘_obstack_memory_used’:
../../libiberty/obstack.c:301:3: error: unknown type name ‘_OBSTACK_SIZE_T’
   _OBSTACK_SIZE_T nbytes = 0;
   ^~~~~~~~~~~~~~~
At top level:
../../libiberty/obstack.c:89:1: warning: ‘call_chunkfun’ defined but not used [-Wunused-function]
 call_chunkfun (struct obstack *h, size_t size)
 ^~~~~~~~~~~~~
Makefile:1048: recipe for target 'obstack.o' failed
make[5]: *** [obstack.o] Error 1
make[5]: Leaving directory '/spksrc/cross/gcc/work-x64-6.1/gcc-8.2.0/build/libiberty'
Makefile:14648: recipe for target 'all-stage2-libiberty' failed
make[4]: *** [all-stage2-libiberty] Error 2
make[4]: Leaving directory '/spksrc/cross/gcc/work-x64-6.1/gcc-8.2.0/build'
Makefile:26993: recipe for target 'stage2-bubble' failed
make[3]: *** [stage2-bubble] Error 2
make[3]: Leaving directory '/spksrc/cross/gcc/work-x64-6.1/gcc-8.2.0/build'
Makefile:952: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/spksrc/cross/gcc/work-x64-6.1/gcc-8.2.0/build'
Makefile:36: recipe for target 'myCompile' failed
make[1]: *** [myCompile] Error 2
make[1]: Leaving directory '/spksrc/cross/gcc'
../../mk/spksrc.cross-cc.mk:123: recipe for target 'arch-x64' failed
make: [arch-x64] Error 2 (ignored)

The build environment is a Debian 'Jessie' with GCC 4.9.2/libc 2.19. Here is the Makefile I've created for this package:

# ----------------------

PKG_NAME = gcc
PKG_VERS = 8.2.0
PKG_EXT = tar.xz
PKG_DIST_NAME = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT)
PKG_DIST_SITE = http://mirror.ibcp.fr/pub/gnu/gcc/gcc-8.2.0
PKG_DIR = $(PKG_NAME)-$(PKG_VERS)

DEPENDS =

HOMEPAGE = https://gcc.gnu.org/
COMMENT  = GNU Compiler Collection
LICENSE  = GNU GPL v3

CONFIGURE_ARGS =

CONFIGURE_TARGET = myConfigure
COMPILE_TARGET   = myCompile
INSTALL_TARGET   = myInstall

include ../../mk/spksrc.cross-cc.mk

.PHONY: myConfigure
myConfigure:
	$(RUN) ; contrib/download_prerequisites
	$(RUN) ; mkdir build && cd build && env $(ENV) ../configure -v \
		--prefix=$(INSTALL_PREFIX) \
		--build=x86_64-linux-gnu \
		--host=x86_64-linux-gnu \
		--target=x86_64-linux-gnu \
		--enable-checking=release \
		--enable-languages=c,c++ \
		--disable-multilib

.PHONY: myCompile
myCompile:
	$(RUN) ; cd build && env $(ENV) make

.PHONY: myInstall
myInstall:
	$(RUN) ; cd build && env $(ENV) make install

# ----------------------

I've searched online for answers to my problem but I haven't found any. Can someone please help? Let me know if you need me to provide more information on my setup.

Cheers,

Marc.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux