Bug 164418 - [PATCH] shells/mksh doesn't build with Clang.
Summary: [PATCH] shells/mksh doesn't build with Clang.
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Martin Wilke
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-23 20:10 UTC by James Kelly
Modified: 2012-03-04 13:00 UTC (History)
0 users

See Also:


Attachments
file.diff (565 bytes, patch)
2012-01-23 20:10 UTC, James Kelly
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James Kelly 2012-01-23 20:10:07 UTC
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

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

How-To-Repeat: Build shells/mksh using Clang.
Comment 1 Edwin Groothuis freebsd_committer 2012-01-23 20:10:18 UTC
Responsible Changed
From-To: freebsd-ports-bugs->miwi

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer 2012-03-04 12:59:54 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"
Comment 3 Martin Wilke freebsd_committer 2012-03-04 12:59:57 UTC
State Changed
From-To: open->closed

Committed. Thanks!