Project

General

Profile

Bug #8454

libzpool build fails if no LINTLIB after 7431

Added by Igor Kozhukhov about 2 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2017-07-03
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

build of libzpool failed if we have no LINTLIB target build

easy fix is:

igor@z172:~/users/igor/dilos-illumos$ g diff
diff --git a/usr/src/lib/libzpool/Makefile.com b/usr/src/lib/libzpool/Makefile.com
index c41f7d61d7..14d5437e64 100644
--- a/usr/src/lib/libzpool/Makefile.com
+++ b/usr/src/lib/libzpool/Makefile.com
@@ -61,6 +61,7 @@ CLEANFILES += $(EXTPICS)

 $(LINTLIB) := SRCS=    $(SRCDIR)/$(LINTSRC)
 $(LINTLIB): ../common/zfs.h
+$(LIBS): ../common/zfs.h

 C99MODE=       -xc99=%all
 C99LMODE=      -Xc99=%all

next problem: build failed by gcc5:

+ /usr/gcc/5/bin/gcc -fident -finline -fno-inline-functions -fno-builtin -fno-asm -fdiagnostics-sh
ow-option -nodefaultlibs -D__sun -m64 -mtune=opteron -Ui386 -U__i386 -fno-strict-aliasing -fno-unit-at-a-time -fno-optimize-sibling-calls -O2 -D_ASM_INLINES -ffreestanding -mno-red-zone -mno-mmx -mno-sse -mno-sse2 -mno-3dnow -mfpmath=387 -msave-args -Wall -Wextra -gdwarf-2 -std=gnu99 -msave-args -Werror -Wno-missing-braces -Wno-sign-compare -Wno-unknown-pragmas -Wno-unused-parameter -Wno-missing-field-initializers -fno-aggressive-loop-optimizations -fno-inline-small-functions -fno-inline-functions-called-once -fno-ipa-cp -fno-ipa-sra -fno-ipa-icf -fstack-protector -D_KERNEL -ffreestanding -D_SYSCALL32 -D_SYSCALL32_IMPL -D_ELF64 -D_DDI_STRICT -Dsun -D__sun -D__SVR4 -DDEBUG -I../
../intel -I../../common/fs/zfs -I../../common/fs/zfs/lua -I/rws1/users/igor/dilos-illumos/usr/src/
common -I../../../common/zfs -nostdinc -I../../common -c -o debug64/lstrlib.o ../../common/fs/zfs/
lua/lstrlib.c -mcmodel=kernel
../../common/fs/zfs/lua/lstrlib.c: In function 'addquoted':
../../common/fs/zfs/lua/lstrlib.c:37:27: error: comparison is always true due to limited range of
data type [-Werror=type-limits]
 #define iscntrl(C) ((((C) >= 0) && ((C) <= 0x1f)) || ((C) == 0x7f))
                           ^
../../common/fs/zfs/lua/lstrlib.c:866:28: note: in expansion of macro 'iscntrl'
     else if (*s == '\0' || iscntrl(uchar(*s))) {
                            ^
cc1: all warnings being treated as errors
*** Error code 1
dmake: Fatal error: Command failed for target `debug64/lstrlib.o'

proposed fix like in mdb http://src.illumos.org/source/xref/illumos-gate/usr/src/cmd/mdb/common/libstand/ctype.c#76:

igor@z172:~/users/igor/dilos-illumos$ g diff
diff --git a/usr/src/uts/common/fs/zfs/lua/lstrlib.c b/usr/src/uts/common/fs/zfs/lua/lstrlib.c
index b6279edc4a..72e7b935f9 100644
--- a/usr/src/uts/common/fs/zfs/lua/lstrlib.c
+++ b/usr/src/uts/common/fs/zfs/lua/lstrlib.c
@@ -34,7 +34,6 @@
  */
 #define tolower(C)     (((C) >= 'A' && (C) <= 'Z') ? (C) - 'A' + 'a' : (C))
 #define toupper(C)      (((C) >= 'a' && (C) <= 'z') ? (C) - 'a' + 'A': (C))
-#define iscntrl(C)     ((((C) >= 0) && ((C) <= 0x1f)) || ((C) == 0x7f))
 #define isgraph(C)     ((C) >= 0x21 && (C) <= 0x7E)
 #define ispunct(C)     (((C) >= 0x21 && (C) <= 0x2F) || \
     ((C) >= 0x3A && (C) <= 0x40) || \
@@ -287,6 +286,13 @@ static const char *classend (MatchState *ms, const char *p) {
 }

+static int
+iscntrl(int c)
+{
+       return ((c < 0x20) || (c == 0x7f));
+}
+
+
 static int match_class (int c, int cl) {
   int res;
   switch (tolower(cl)) {

History

#1

Updated by Igor Kozhukhov about 2 years ago

  • Description updated (diff)
#2

Updated by Gordon Ross over 1 year ago

  • Subject changed from degradation after illumos#7431 to libzpool build fails if no LINTLIB target after 7431
#3

Updated by Gordon Ross over 1 year ago

  • Subject changed from libzpool build fails if no LINTLIB target after 7431 to libzpool build fails if no LINTLIB after 7431
#4

Updated by Electric Monk about 1 year ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 84f2736904a911587ccd1cf1e4543493fcab31f4

commit  84f2736904a911587ccd1cf1e4543493fcab31f4
Author: Igor Kozhukhov <igor@dilos.org>
Date:   2018-05-11T18:32:07.000Z

    8454 libzpool build fails if no LINTLIB after 7431
    Reviewed by: Matthew Ahrens <mahrens@delphix.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF