Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Jan 2012 20:03:47 GMT
From:      James Kelly <james@hicag.org>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/164418: [PATCH] shells/mksh doesn't build with Clang.
Message-ID:  <201201232003.q0NK3lfF044891@red.freebsd.org>
Resent-Message-ID: <201201232010.q0NKA7dt087657@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         164418
>Category:       ports
>Synopsis:       [PATCH] shells/mksh doesn't build with Clang.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 23 20:10:07 UTC 2012
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201232003.q0NK3lfF044891>