From nobody@FreeBSD.org  Mon Jan 23 20:03:47 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A9635106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 23 Jan 2012 20:03:47 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 8D3388FC12
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 23 Jan 2012 20:03:47 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q0NK3l08044905
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 23 Jan 2012 20:03:47 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q0NK3lfF044891;
	Mon, 23 Jan 2012 20:03:47 GMT
	(envelope-from nobody)
Message-Id: <201201232003.q0NK3lfF044891@red.freebsd.org>
Date: Mon, 23 Jan 2012 20:03:47 GMT
From: James Kelly <james@hicag.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [PATCH] shells/mksh doesn't build with Clang.
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         164418
>Category:       ports
>Synopsis:       [PATCH] shells/mksh doesn't build with Clang.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    miwi
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 23 20:10:07 UTC 2012
>Closed-Date:    Sun Mar 04 12:59:58 UTC 2012
>Last-Modified:  Sun Mar  4 13:00:25 UTC 2012
>Originator:     James Kelly
>Release:        9.0-STABLE
>Organization:
>Environment:
FreeBSD megalodon.build.stf.ord.tilted.net 9.0-STABLE FreeBSD 9.0-STABLE #1: Sun Jan 22 16:32:40 CST 2012     jjk@trilobite.build.stf.ord.tilted.net:/.amd_mnt/FreeBSD_9/obj/amd64.amd64/.amd_mnt/FreeBSD_9/src/sys/GREENHOUSE  amd64
>Description:
shells/mksh does not build using Clang because it doesn't support a build-time option the port uses.


.. checking if the final link command may succeed
clang -O2 -pipe -fno-strict-aliasing -std=gnu99 -Wall -I. -I'/var/tmp/ports-work/.amd_mnt/ports-current/ports/shells/mksh/work/mksh'  -DHAVE_ATTRIBUTE_BOUNDED=1 -DHAVE_ATTRIBUTE_FORMAT=1 -DHAVE_ATTRIBUTE_NONNULL=1 -DHAVE_ATTRIBUTE_NORETURN=1 -DHAVE_ATTRIBUTE_UNUSED=1 -DHAVE_ATTRIBUTE_USED=1 -DHAVE_SYS_BSDTYPES_H=0 -DHAVE_SYS_FILE_H=1 -DHAVE_SYS_MKDEV_H=0 -DHAVE_SYS_MMAN_H=1 -DHAVE_SYS_PARAM_H=1 -DHAVE_SYS_SELECT_H=1 -DHAVE_SYS_SYSMACROS_H=0 -DHAVE_BSTRING_H=0 -DHAVE_GRP_H=1 -DHAVE_LIBGEN_H=1 -DHAVE_LIBUTIL_H=1 -DHAVE_PATHS_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_ULIMIT_H=1 -DHAVE_VALUES_H=0  -fwhole-program --combine -Wno-error -o a.out conftest.c  || for _f in ${tcfn}*; do test x"${_f}" = x"mksh.1" || rm -f "${_f}"; done
clang: error: unsupported option '-combine'
==> checking if the final link command may succeed... no
*** Error code 1

>How-To-Repeat:
Build shells/mksh using Clang.
>Fix:
Use -c lto instead of -c combine. lto auto-detects if Clang or GCC 4.5+ link time optimization can be used, otherwise it will fallback to combine.

clang -O2 -pipe -fno-strict-aliasing -std=gnu99 -Wall -I. -I'/var/tmp/ports-work/.amd_mnt/ports-protea/ports/shells/mksh/work/mksh'  -DHAVE_ATTRIBUTE_BOUNDED=1 -DHAVE_ATTRIBUTE_FORMAT=1 -DHAVE_ATTRIBUTE_NONNULL=1 -DHAVE_ATTRIBUTE_NORETURN=1 -DHAVE_ATTRIBUTE_UNUSED=1 -DHAVE_ATTRIBUTE_USED=1 -DHAVE_SYS_BSDTYPES_H=0 -DHAVE_SYS_FILE_H=1 -DHAVE_SYS_MKDEV_H=0 -DHAVE_SYS_MMAN_H=1 -DHAVE_SYS_PARAM_H=1 -DHAVE_SYS_SELECT_H=1 -DHAVE_SYS_SYSMACROS_H=0 -DHAVE_BSTRING_H=0 -DHAVE_GRP_H=1 -DHAVE_LIBGEN_H=1 -DHAVE_LIBUTIL_H=1 -DHAVE_PATHS_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_ULIMIT_H=1 -DHAVE_VALUES_H=0 -Wno-error -c conftest.c
clang -O2 -pipe -fno-strict-aliasing -std=gnu99 -Wall  -o a.out conftest.o  || for _f in ${tcfn}*; do test x"${_f}" = x"mksh.1" || rm -f "${_f}"; done
clang: warning: argument unused during compilation: '-std=gnu99'
==> checking if the final link command may succeed... yes


Index: Makefile
===================================================================
--- Makefile	(revision 4049)
+++ Makefile	(working copy)
@@ -28,7 +29,7 @@
 	${GZCAT} ${DISTDIR}/${DISTFILES} | ${CPIO} -id
 
 do-build:
-	cd ${WRKSRC} && CFLAGS="${CFLAGS}" CC="${CC}" LDFLAGS="${LDFLAGS}" CPPFLAGS="${CPPFLAGS}" SHELL=${SH} ${SH} ${WRKSRC}/Build.sh -r -combine
+	cd ${WRKSRC} && CFLAGS="${CFLAGS}" CC="${CC}" LDFLAGS="${LDFLAGS}" CPPFLAGS="${CPPFLAGS}" SHELL=${SH} ${SH} ${WRKSRC}/Build.sh -r -c lto
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/mksh ${PREFIX}/bin

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->miwi 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Jan 23 20:10:18 UTC 2012 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=164418 
State-Changed-From-To: open->closed 
State-Changed-By: miwi 
State-Changed-When: Sun Mar 4 12:59:57 UTC 2012 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=164418 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/164418: commit references a PR
Date: Sun,  4 Mar 2012 12:59:54 +0000 (UTC)

 miwi        2012-03-04 12:59:42 UTC
 
   FreeBSD ports repository
 
   Modified files:
     shells/mksh          Makefile 
   Log:
   - Fix build with CLANG
   
   PR:             164418
   
   Revision  Changes    Path
   1.33      +1 -1      ports/shells/mksh/Makefile
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
