I have now investigated further, by trying to compile the pre-processed *.i source file. This naturally does not need any -D... and -I... command line arguments.
So I started with this command line:
gcc -c gdevpdfb.i
which did well. Then I added from the full command line each bunch of arguments which are not -D... or -I...:
and at the last of these it hung again, So I tried to remove arguments and saw -O3 as a good candidate, and, yes, removing it made gcc finish. Seems that -O3 is the culprit!
So let us try the complete command line but without -O3:
I have now investigated further, by trying to compile the pre-processed *.i source file. This naturally does not need any -D... and -I... command line arguments.
So I started with this command line:
gcc -c gdevpdfb.i
which did well. Then I added from the full command line each bunch of arguments which are not -D... or -I...:
gcc -fPIC -O2 -fPIC -Wdate-time -c gdevpdfb.i
gcc -fPIC -O2 -Wdate-time -Wall -Wstrict-prototypes -Wundef -Wmissing- declarations -Wmissing- prototypes -Wwrite-strings -fno-strict- aliasing -Werror= declaration- after-statement -fno-builtin -fno-common -Werror=return-type -c gdevpdfb.i
gcc -fPIC -O2 -Wdate-time -Wall -Wstrict-prototypes -Wundef -Wmissing- declarations -Wmissing- prototypes -Wwrite-strings -fno-strict- aliasing -Werror= declaration- after-statement -fno-builtin -fno-common -Werror=return-type -g -O3 -fdebug- prefix- map=`pwd` =. -fstack- protector- strong -Wformat -Werror= format- security -c gdevpdfb.i
and at the last of these it hung again, So I tried to remove arguments and saw -O3 as a good candidate, and, yes, removing it made gcc finish. Seems that -O3 is the culprit!
So let us try the complete command line but without -O3:
gcc -fPIC -O2 -Wdate-time -Wall -Wstrict-prototypes -Wundef -Wmissing- declarations -Wmissing- prototypes -Wwrite-strings -fno-strict- aliasing -Werror= declaration- after-statement -fno-builtin -fno-common -Werror=return-type -g -fdebug- prefix- map=`pwd` =. -fstack- protector- strong -Wformat -Werror= format- security -fno-strict- aliasing -o gdevpdfb.o -c gdevpdfb.i
This also completes.
And back into the ghostscript source tree to do the whole thing:
gcc -save-temps -DHAVE_MKSTEMP -DHAVE_FILE64 -DHAVE_FSEEKO -DHAVE_MKSTEMP64 -DHAVE_FONTCONFIG -DHAVE_LIBIDN -DHAVE_SETLOCALE -DHAVE_BSWAP32 -DHAVE_BYTESWAP_H -DHAVE_STRERROR -DHAVE_ISNAN -DHAVE_ISINF -DHAVE_ PREAD_PWRITE= 1 -DGS_RECURSIVE_ MUTEXATTR= PTHREAD_ MUTEX_RECURSIVE -fPIC -O2 -fPIC -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -Wstrict-prototypes -Wundef -Wmissing- declarations -Wmissing- prototypes -Wwrite-strings -fno-strict- aliasing -Werror= declaration- after-statement -fno-builtin -fno-common -Werror=return-type -DHAVE_STDINT_H=1 -DHAVE_DIRENT_H=1 -DHAVE_SYS_DIR_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_ SYS_TIMES_ H=1 -DHAVE_INTTYPES_H=1 -DHAVE_LIBDL=1 -DGX_COLOR_ INDEX_TYPE= "unsigned long long" -D__USE_UNIX98=1 -g -fdebug- prefix- map=/home/ ubuntu/ ubuntu/ ghostscript/ ghostscript- 9.50~dfsg= . -fstack- protector- strong -Wformat -Werror= format- security -DHAVE_RESTRICT=1 -DUSE_LIBPAPER -I/usr/ include/ powerpc64le- linux-gnu -fno-strict- aliasing -DHAVE_ POPEN_PROTO= 1 -DGS_DEVS_SHARED -DGS_DEVS_ SHARED_ DIR=\"/ usr/lib/ ghostscript/ 9.50\" -I./soobj -I./base -I./soobj -I./devices -I./devices/vector -o ./soobj/gdevpdfb.o -c ./devices/ vector/ gdevpdfb. c
but without -O3, this also works.
So the workaround is not using -O3 on ppc64el, but the bug is still there. gcc needs to get fixed.