From owner-freebsd-ports-bugs@freebsd.org Fri Dec 18 06:25:53 2015 Return-Path: Delivered-To: freebsd-ports-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F3AAA4ACEA for ; Fri, 18 Dec 2015 06:25:53 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F32FC1E0F for ; Fri, 18 Dec 2015 06:25:52 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id tBI6Pqar018409 for ; Fri, 18 Dec 2015 06:25:52 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-ports-bugs@FreeBSD.org Subject: [Bug 205394] lang/gcc49, lang/gcc5, devel/powerpc64-gcc on powerpc64: lib32's libedit fails to compile, 10 line source shows the problem Date: Fri, 18 Dec 2015 06:25:52 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: markmi@dsl-only.net X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bapt@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter cc flagtypes.name Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2015 06:25:53 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205394 Bug ID: 205394 Summary: lang/gcc49, lang/gcc5, devel/powerpc64-gcc on powerpc64: lib32's libedit fails to compile, 10 line source shows the problem Product: Ports & Packages Version: Latest Hardware: ppc OS: Any Status: New Severity: Affects Only Me Priority: --- Component: Individual Port(s) Assignee: bapt@FreeBSD.org Reporter: markmi@dsl-only.net CC: freebsd-ppc@FreeBSD.org CC: freebsd-ppc@FreeBSD.org Flags: maintainer-feedback?(bapt@FreeBSD.org) Assignee: bapt@FreeBSD.org The following simple example shows how/why buildworld for lib32 on powerpc64 fails to compile libedit. lang/gcc49, lang/gcc5, and devel/powerpc64-gcc all fail to compile the following "main.c" for -m32 on powerpc64. #include "/usr/include/stddef.h" const wchar_t* test(const wchar_t* p) { return p; } int main(void) { const wchar_t* wcpt = test(L"test"); const wchar_t wcarray[] = L"test"; return 0; } For "gcc49 -m32 main.c" the result is: # gcc49 -m32 main.c main.c: In function 'main': main.c:7:37: warning: passing argument 1 of 'test' from incompatible pointer type const wchar_t* wcpt = test(L"test"); ^ main.c:3:16: note: expected 'const wchar_t *' but argument is of type 'long int *' const wchar_t* test(const wchar_t* p) { return p; } ^ main.c:8:5: error: array of inappropriate type initialized from string constant const wchar_t wcarray[] = L"test"; ^ gcc5 and powerpc64-gcc get the same. A possible fix via an addition to lang/gcc5's and devel/powerpc64-gcc's patch-gcc-freebsd-powerpc64 would look like (tabs likely not preserved): +@@ -304,7 +317,7 @@ + + /* rs6000.h gets this wrong for FreeBSD. We use the GCC defaults instead. */ + #undef WCHAR_TYPE +-#define WCHAR_TYPE (TARGET_64BIT ? "int" : "long int") ++#define WCHAR_TYPE "int" + #undef WCHAR_TYPE_SIZE + #define WCHAR_TYPE_SIZE 32 + It appears that lang/gcc49, lang/gcc5-devel, and lang/gcc6-devel do not have a patch-gcc-freebsd-powerpc64 (yet?). Nor lang/gcc48 or older. At least for gcc49 the content of a patch for this issue could be similar from what I can see. I've not looked at the details for the others. Note: FreeBSD for powerpc64 and its lib32 context define ___wchar_t as int: # grep wchar_t /usr/include/machine/_types.h typedef int ___wchar_t; #define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ #define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ -- You are receiving this mail because: You are the assignee for the bug.