From owner-freebsd-bugs@FreeBSD.ORG Tue Jul 9 12:10:00 2013 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BC491872 for ; Tue, 9 Jul 2013 12:10:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id A3C701C20 for ; Tue, 9 Jul 2013 12:10:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r69CA0Xm060757 for ; Tue, 9 Jul 2013 12:10:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r69CA0gB060756; Tue, 9 Jul 2013 12:10:00 GMT (envelope-from gnats) Resent-Date: Tue, 9 Jul 2013 12:10:00 GMT Resent-Message-Id: <201307091210.r69CA0gB060756@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Mike Gelfand Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7EB5E623 for ; Tue, 9 Jul 2013 12:00:59 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121]) by mx1.freebsd.org (Postfix) with ESMTP id 58E0E1BBC for ; Tue, 9 Jul 2013 12:00:59 +0000 (UTC) Received: from oldred.freebsd.org ([127.0.1.6]) by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r69C0wIg051443 for ; Tue, 9 Jul 2013 12:00:58 GMT (envelope-from nobody@oldred.freebsd.org) Received: (from nobody@localhost) by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r69C0wwf051426; Tue, 9 Jul 2013 12:00:58 GMT (envelope-from nobody) Message-Id: <201307091200.r69C0wwf051426@oldred.freebsd.org> Date: Tue, 9 Jul 2013 12:00:58 GMT From: Mike Gelfand To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: misc/180413: Compilation failure with _DONT_USE_CTYPE_INLINE_ defined X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jul 2013 12:10:00 -0000 >Number: 180413 >Category: misc >Synopsis: Compilation failure with _DONT_USE_CTYPE_INLINE_ defined >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jul 09 12:10:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Mike Gelfand >Release: 9.1 >Organization: IASO Backup >Environment: FreeBSD build-machine-BSD9.1 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243825: Tue Dec 4 09:23:10 UTC 2012 root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 >Description: I've compiled our software on 9.1 and then tried running it on 8.3. Apparently, there is a binary incompatibility leading to _ThreadRuneLocale symbol not being resolved. So I decided to workaround the issue by compiling with _DONT_USE_CTYPE_INLINE_ define. Than helped in the way that the aforementioned symbol is no longed being imported by the binary, but while I was trying to compile, the issue I'm now writing about appeared. When _DONT_USE_CTYPE_INLINE_ defined is being used, compilation fails since /usr/include/runetype.h is no longer being included by /usr/include/_ctype.h, which in turn leads to _RuneLocale struct being undefined, while still used in /usr/include/xlocale/_ctype.h. >How-To-Repeat: Compile this small sample: -----8<----- code begin ----- #define _DONT_USE_CTYPE_INLINE_ #include int main() { return 0; } -----8<----- code end ----- >Fix: I used this simple patch below, but I know it's not a good one, so you are free to fix it properly :) -----8<----- patch begin ----- --- /usr/include/_ctype.h.orig +++ /usr/include/_ctype.h @@ -85,14 +85,14 @@ extern int __mb_sb_limit; +#include + /* * Use inline functions if we are allowed to and the compiler supports them. */ #if !defined(_DONT_USE_CTYPE_INLINE_) && \ (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus)) -#include - static __inline int __maskrune(__ct_rune_t _c, unsigned long _f) { --- /usr/include/runetype.h.orig +++ /usr/include/runetype.h @@ -82,6 +82,9 @@ int __variable_len; /* how long that data is */ } _RuneLocale; +#if !defined(_DONT_USE_CTYPE_INLINE_) && \ + (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus)) + #define _RUNE_MAGIC_1 "RuneMagi" /* Indicates version 0 of RuneLocale */ __BEGIN_DECLS extern const _RuneLocale _DefaultRuneLocale; @@ -103,4 +106,6 @@ #define _CurrentRuneLocale (__getCurrentRuneLocale()) __END_DECLS +#endif /* _DONT_USE_CTYPE_INLINE_ */ + #endif /* !_RUNETYPE_H_ */ -----8<----- patch end ----- >Release-Note: >Audit-Trail: >Unformatted: