Subject: Re: bug#35650: [PATCH] Improving HP-UX support

From: "Osipov, Michael" <[email-masked]>
Date: Wed, 15 May 2019 11:30:26 +0200

let's examine #include_next first:

Am 2019-05-14 um 18:26 schrieb Paul Eggert:
> On 5/14/19 6:52 AM, Osipov, Michael wrote:
>>
>> aCC does not exit with non-zero, it just prints a warning.
> 
> OK, I installed the attached patch to try to fix this problem with
> 'configure'. Please give it a try. We may need some more patches to fix
> the problems you evidently observed with #include_next, getacl, aclsort,
> and sys/bitypes.h.
> 

configure.ac:
 > configure:8765: checking whether the preprocessor supports include_next
 > configure:8803: /opt/aCC/bin/aCC -AC99 -c -g 
-I/opt/ports/coreutils/include -D_INCLUDE_STDC__SOURCE_199901 
-Iconftestd1b -Iconftestd2 conftest.c >&5
 > configure:8803: $? = 0
 > configure:8824: result: yes

result:
 >   CC       src/b2sum-md5sum.o
 > cpp: "./lib/stdlib.h", line 28: error 4052: Unknown preprocessing 
directive.
 > cpp: "./lib/stdio.h", line 43: error 4052: Unknown preprocessing 
directive.
 > cpp: "/usr/include/sys/stdsyms.h", line 63: warning 2001: 
Redefinition of macro _INCLUDE_STDC__SOURCE_199901.
 > cpp: "./lib/stddef.h", line 55: error 4052: Unknown preprocessing 
directive.
 > cpp: "./lib/sys/types.h", line 39: error 4052: Unknown preprocessing 
directive.
 > cpp: "./lib/unistd.h", line 40: error 4052: Unknown preprocessing 
directive.
 > cpp: "./lib/stdlib.h", line 28: error 4052: Unknown preprocessing 
directive.
 > cpp: "./lib/time.h", line 41: error 4052: Unknown preprocessing 
directive.
 > cpp: "./lib/sys/stat.h", line 47: error 4052: Unknown preprocessing 
directive.
 > cpp: "./lib/sys/time.h", line 39: error 4052: Unknown preprocessing 
directive.
 > cpp: "./lib/limits.h", line 27: error 4052: Unknown preprocessing 
directive.
 > cpp: "./lib/time.h", line 35: error 4052: Unknown preprocessing 
directive.
 > cpp: "./lib/string.h", line 41: error 4052: Unknown preprocessing 
directive.
 > cpp: "./lib/errno.h", line 27: error 4052: Unknown preprocessing 
directive.
 > cpp: "./lib/stdlib.h", line 36: error 4052: Unknown preprocessing 
directive.
 > cpp: "./lib/fcntl.h", line 61: error 4052: Unknown preprocessing 
directive.
 > cpp: "./lib/dirent.h", line 27: error 4052: Unknown preprocessing 
directive.
 > cpp: "./lib/inttypes.h", line 41: error 4052: Unknown preprocessing 
directive.
 > cpp: "./lib/stdint.h", line 77: error 4052: Unknown preprocessing 
directive.
 > cpp: "./lib/inttypes.h", line 41: error 4052: Unknown preprocessing 
directive.
 > cpp: "./lib/time.h", line 35: error 4052: Unknown preprocessing 
directive.
 > cpp: "./lib/wchar.h", line 55: error 4052: Unknown preprocessing 
directive.
 > cpp: "./lib/inttypes.h", line 61: error 4062: "This file assumes that 
'int' has exactly 32 bits. Please report your platform and compiler to 
<[email-masked]>."
 > cpp: "./lib/time.h", line 35: error 4052: Unknown preprocessing 
directive.
 > cpp: "./lib/ctype.h", line 35: error 4052: Unknown preprocessing 
directive.
 > cpp: "./lib/locale.h", line 41: error 4052: Unknown preprocessing 
directive.
 > gmake[2]: *** [Makefile:12142: src/b2sum-md5sum.o] Error 1
 > gmake[2]: Leaving directory '/tmp/system-compile/gnu/coreutils-8.31'

command in question:
 > + /opt/aCC/bin/aCC -AC99 -I. -I./lib -include config.h 
-DHASH_ALGO_BLAKE2=1 -Ilib -I./lib -Isrc -I./src 
-I/opt/ports/coreutils/include -D_INCLUDE_STDC__SOURCE_199901 -g -c -o 
src/b2sum-md5sum.o src/md5sum.c +Maked

without the '-include':
 > bash-5.0# /opt/aCC/bin/aCC -AC99 -I. -I./lib  -DHASH_ALGO_BLAKE2=1 
-Ilib -I./lib -Isrc -I./src -I/opt/ports/coreutils/include 
-D_INCLUDE_STDC__SOURCE_199901 -g -c -o src/b2sum-md5sum.o src/md5sum.c 
+Maked
 > "./lib/timespec.h", line 98: warning #2174-D: expression has no effect
 >     assume (-1 <= a.tv_nsec && a.tv_nsec <= 2 * TIMESPEC_HZ);
 >     ^
 >
 > "./lib/timespec.h", line 99: warning #2174-D: expression has no effect
 >     assume (-1 <= b.tv_nsec && b.tv_nsec <= 2 * TIMESPEC_HZ);
 >     ^

According the manual [1] the compiler supports #include_next, but for 
some strange reason it does not when -include is used. The funny thing 
is -include isn't even in the manual.
 > bash-5.0# aCC -include
 > aCC: error 1909: `-include' option requires argument

This one comes from:
 > @USE_XLC_INCLUDE_FALSE@src_b2sum_CPPFLAGS = -include config.h

I will inquire this with HPE because it looks fishy to me.
I don't know how to solve this differently for now, but to disable 
include_next in configure.ac if the compiler is aCC.

Michael

[1] https://support.hpe.com/hpsc/doc/public/display?docId=emr_na-c05054285