From owner-freebsd-current@FreeBSD.ORG Fri Mar 27 15:17:55 2015 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E91A974F; Fri, 27 Mar 2015 15:17:55 +0000 (UTC) Received: from mail-n.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail-n.franken.de", Issuer "Thawte DV SSL CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 76FA124C; Fri, 27 Mar 2015 15:17:55 +0000 (UTC) Received: from [IPv6:2001:67c:370:152:789e:cdca:2174:5587] (unknown [IPv6:2001:67c:370:152:789e:cdca:2174:5587]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTP id A50491C1622C1; Fri, 27 Mar 2015 16:17:50 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: 11.0-CURRENT: SCTP_MAX_CWND, lib/libc/net/sctp_sys_calls.c -r279859 vs. updating to head snaphot -r280598 From: Michael Tuexen In-Reply-To: <24B7C687-9147-42F1-AE49-92F93DC85AA8@dsl-only.net> Date: Fri, 27 Mar 2015 10:17:48 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: References: <24B7C687-9147-42F1-AE49-92F93DC85AA8@dsl-only.net> To: Mark Millard X-Mailer: Apple Mail (2.2070.6) Cc: freebsd-current@freebsd.org, FreeBSD PowerPC ML X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Mar 2015 15:17:56 -0000 > On 26 Mar 2015, at 21:36, Mark Millard wrote: >=20 > Basic context: >=20 > # freebsd-version -ku; uname -apKU > 11.0-CURRENT > 11.0-CURRENT > FreeBSD FBSDG5C0 11.0-CURRENT FreeBSD 11.0-CURRENT #1 r279514M: Sat = Mar 21 05:15:23 PDT 2015 = root@FBSDG5C0:/usr/obj/usr/srcC/sys/GENERIC64vtsc-NODEBUG powerpc = powerpc64 1100062 1100062 >=20 >=20 > The problem: >=20 > Summary of the details that are listed later. Both of the following = exist: >=20 > /usr/src/sys/netinet/sctp.h > /usr/include/netinet/sctp.h >=20 > The first can be newer than the 2nd during buildworld. >=20 > The buildworld compile of /head/lib/libc/net/sctp_sys_calls.c from an = updated /usr/src can/does end up using the second instead of the first, = at least for the powerpc64-xtoolchain-gcc style of buildworld activity = that I am trying. >=20 > The recent addition of SCTP_MAX_CWND ends up with its definition = missing because of this: during the build /usr/include/netinet/sctp.h = ends up being the file included and the compile fails from the missing = additional definition. >=20 > Either the #include paths in /head/lib/libc/net/sctp_sys_calls.c or = the command line arguments should force the /usr/src/sys/netinet/sctp.h = vintage file to be found. The 3 netinet/ relevant includes are shown = below... >=20 >> ... >> #include >> #include >> #include >> #include >=20 > More than sctp.h might have such issues since there are 3 netinet/ = include paths in /head/lib/libc/net/sctp_sys_calls.c . >=20 > I have not checked for other .c files with similar issues for = usage during buildworld. I guess there is something wrong with the build system / Makefiles such = that the entries in the search path for include files are in the wrong order. I don't think this is = related to the concrete patch you are referring to. It only exposes the problem. As I see, you = experience similar problems in other situations to. Maybe someone knowing the build system has to look into it. And it seems = to be somewhat platform specific, since I have not observed this problem when testing the build on amd64 = and arm. Best regards Michael >=20 >=20 > The problem details: >=20 > /head/lib/libc/net/sctp_sys_calls.c -r279859 added: >=20 >> case SCTP_MAX_CWND: >> ((struct sctp_assoc_value *)arg)->assoc_id =3D id; >> break; >=20 > and head (20150325 r280598) contains it. >=20 > But the SCTP_MAX_CWND reference blocks buildworld (for at least = /usr/local/bin/powerpc64-portbld-freebsd11.0-gcc = (powerpc64-xtoolchain=3Dgcc) use): >=20 >> /usr/local/bin/powerpc64-portbld-freebsd11.0-gcc -fpic -DPIC -O2 = -pipe -I/usr/src/lib/libc/include -I/usr/src/lib/libc/../../include = -I/usr/src/lib/libc/powerpc64 -DNLS -D__DBINTERFACE_PRIVATE = -I/usr/src/lib/libc/../../contrib/gdtoa = -I/usr/src/lib/libc/../../contrib/libc-vis -DINET6 = -I/usr/obj/usr/src/lib/libc -I/usr/src/lib/libc/resolv -D_ACL_PRIVATE = -DPOSIX_MISTAKE -I/usr/src/lib/libc/../libmd = -I/usr/src/lib/libc/../../contrib/jemalloc/include -DMALLOC_PRODUCTION = -I/usr/src/lib/libc/../../contrib/tzcode/stdtime = -I/usr/src/lib/libc/stdtime -I/usr/src/lib/libc/locale -DBROKEN_DES = -DPORTMAP -DDES_BUILTIN -I/usr/src/lib/libc/rpc -DYP -DNS_CACHING = -DSYMBOL_VERSIONING -DSYSCALL_COMPAT -std=3Dgnu99 -fstack-protector = -Wsystem-headers -Wall -Wno-format-y2k -Wno-uninitialized = -Wno-pointer-sign -c /usr/src/lib/libc/net/sctp_sys_calls.c -o = sctp_sys_calls.So >>=20 >> /usr/src/lib/libc/net/sctp_sys_calls.c: In function 'sctp_opt_info': >> /usr/src/lib/libc/net/sctp_sys_calls.c:386:7: error: 'SCTP_MAX_CWND' = undeclared (first use in this function) >> case SCTP_MAX_CWND: > ^ > Looking to see where usage and definitions might be in /usr/src for = -r280598 ... >=20 >> # pwd >> /usr/src >> $ find . \( -type d -name .svn -prune \) -or \( -type f -exec grep = SCTP_MAX_CWND {} \; -print \) | more >> case SCTP_MAX_CWND: >> ./lib/libc/net/sctp_sys_calls.c >> case SCTP_MAX_CWND: >> case SCTP_MAX_CWND: >> ./sys/netinet/sctp_usrreq.c >> #define SCTP_MAX_CWND 0x00000032 >> ./sys/netinet/sctp.h >=20 > And looking at the list of includes in = /head/lib/libc/net/sctp_sys_calls.c for -r279859 shows: >=20 >> #include >> __FBSDID("$FreeBSD$"); >>=20 >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >=20 > That there was no complaint about sctp.h being missing suggests that a = was found but did not contain a SCTP_MAX_CWND = definition: so a different one than the above find/grep reported. >=20 > Using a find to report other sctp.h files shows: >=20 >> # find / \( -type d -name .svn -prune \) -or \( -type f -name sctp.h = -print \) | more >> /usr/src/sys/netinet/sctp.h >> /usr/include/netinet/sctp.h >=20 > The diff of those shows the problem if the wrong file is found and = used: >=20 >> # diff /usr/include/netinet/sctp.h /usr/src/sys/netinet/sctp.h >> 34c34 >> < __FBSDID("$FreeBSD: head/sys/netinet/sctp.h 269945 2014-08-13 = 15:50:16Z tuexen $"); >> --- >>> __FBSDID("$FreeBSD: head/sys/netinet/sctp.h 279859 2015-03-10 = 19:49:25Z tuexen $"); >> 130a131 >>> #define SCTP_MAX_CWND 0x00000032 >=20 >=20 >=20 >=20 > Context details: >=20 >> make -j 8 CROSS_TOOLCHAIN=3Dpowerpc64-gcc=20 >> WITHOUT_CLANG_BOOTSTRAP=3D WITHOUT_CLANG=3D WITHOUT_CLANG_IS_CC=3D \ >> WITHOUT_LLDB=3D \ >> WITH_GCC_BOOTSTRAP=3D WITH_GCC=3D WITHOUT_GNUCXX=3D \ >> WITHOUT_BOOT=3D WITHOUT_LIB32=3D \ >> buildworld buildkernel \ >> KERNCONF=3DGENERIC64vtsc-NODEBUG >> TARGET=3Dpowerpc TARGET_ARCH=3Dpowerpc64 >=20 >> # svnlite info /usr/src >> Path: . >> Working Copy Root Path: /usr/src >> URL: https://svn0.us-west.freebsd.org/base/head >> Relative URL: ^/head >> Repository Root: https://svn0.us-west.freebsd.org/base >> Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f >> Revision: 280615 >> Node Kind: directory >> Schedule: normal >> Last Changed Author: hselasky >> Last Changed Rev: 280598 >> Last Changed Date: 2015-03-25 06:32:27 -0700 (Wed, 25 Mar 2015) >=20 > signals.h and pthread.h have been updated to more recent than -r280598 = in order to avoid the __nonnull issues that exist as of -r280598. >=20 >> # svnlite st /usr/src --no-ignore >> ? /usr/src/.snap >> ? /usr/src/restoresymtable >> M /usr/src/sys/ddb/db_main.c >> M /usr/src/sys/ddb/db_script.c >> ? /usr/src/sys/powerpc/conf/GENERIC64vtsc >> ? /usr/src/sys/powerpc/conf/GENERIC64vtsc-NODEBUG >> ? /usr/src/sys/powerpc/conf/GENERICvtsc >> ? /usr/src/sys/powerpc/conf/GENERICvtsc-NODEBUG >> M /usr/src/sys/powerpc/ofw/ofw_machdep.c >> M /usr/src/sys/powerpc/ofw/ofwcall64.S >=20 > (The .c/.S changes are tied to a PowerMac-G5-specific boot-problem fix = and getting information from early boot failures if I get any more. The = GENERIC's remove ps3 in order to have both vt and sc at the same = time.) >=20 >> # more /etc/src.conf=20 >> NO_WERROR=3D >> WITH_LIBCPLUSPLUS=3D >> CC=3D/usr/local/bin/powerpc64-portbld-freebsd11.0-gcc >> CXX=3D/usr/local/bin/powerpc64-portbld-freebsd11.0-g++ >> CPP=3D/usr/local/bin/powerpc64-portbld-freebsd11.0-cpp >> CROSS_BINUTILS_PREFIX=3D/usr/local/powerpc64-freebsd/bin/ >> X_COMPILER_TYPE=3Dgcc >> CXXFLAGS+=3D-I/usr/obj/usr/srcC/tmp/usr/include/c++/v1/. -std=3Dgnu++11= -L/usr/obj/usr/srcC/lib/libc++/. >> CXXFLAGS+=3D-I/usr/include/c++/v1/. -std=3Dgnu++11 -L/usr/lib/. >=20 > (The above and just below experiments with mostly(?) avoiding use of = gcc 4.2.1, even for CC/CXX/CPP contexts.) >=20 >> # ls -FPal /usr/bin/g[+c]* >> lrwxr-xr-x 1 root wheel 48 Mar 20 02:03 /usr/bin/g++@ -> = /usr/local/bin/powerpc64-portbld-freebsd11.0-g++ >> lrwxr-xr-x 1 root wheel 48 Mar 19 04:20 /usr/bin/gcc@ -> = /usr/local/bin/powerpc64-portbld-freebsd11.0-gcc >=20 >> # more /etc/make.conf >> WRKDIRPREFIX=3D/usr/obj/portswork >> #WITH_DEBUG=3D >> MALLOC_PRODUCTION=3D >=20 > =3D=3D=3D > Mark Millard > markmi at dsl-only.net >=20 >=20