[llvmlinux] Errors building on OS X, and questions

Rick Mann rmann at latencyzero.com
Fri Nov 8 00:04:19 UTC 2013


Hi everyone. I’m excited about the possibility of building the Linux kernel using LLVM and hosted on OS X. Not sure if that’s a goal of your project (the hosted-on-OS X part), or if it’s even reasonable to expect I should be able to do that (I think it is, but I could be wrong).

I’m building on OS X 10.9, have Xcode 5.0.2 installed, targeting ARM/BeagleBone.

In any case, I downloaded the script and gave it a shot. The tools built, but then it ran into problems. Some security warnings, and then I think some things were called with different options (xargs, etc.), and some other errors.

The first error, I think, is "Error in reading or end of file” while building "USB Gadget Support”. Then there’s some problem with the way xargs is called:

xargs: illegal option -- -
usage: xargs [-0opt] [-E eofstr] [-I replstr [-R replacements]] [-J replstr]
             [-L number] [-n number [-x]] [-P maxprocs] [-s size]
             [utility [argument ...]]
make[2]: *** [kernel-quilt-clean-broken-symlinks] Error 1

Anyway, I’m eager to keep trying to do this, if I could get some help from the community. Thanks!

---------------------



---------------------------------------------------------------------
Configuring kernel...
---------------------------------------------------------------------
if [ -n "/Users/rmann/Projects/LFS/LLVMLinux/llvmlinux/toolchain/clang/src/clang" ] ; then \
		(cd /Users/rmann/Projects/LFS/LLVMLinux/llvmlinux/toolchain/clang/src/clang ; xx=$(git log -1 --oneline | cut -d" " -f1) ; sed -i -e "s#-llvmlinux#-llvmlinux-C.$xx#g" /Users/rmann/Projects/LFS/LLVMLinux/llvmlinux/targets/beaglebone/src/bbone/kernel/.config) ; \
	fi
if [ -n "/Users/rmann/Projects/LFS/LLVMLinux/llvmlinux/toolchain/clang/src/llvm" ] ; then \
		(cd /Users/rmann/Projects/LFS/LLVMLinux/llvmlinux/toolchain/clang/src/llvm ; xx=$(git log -1 --oneline | cut -d" " -f1) ; sed -i -e "s#-llvmlinux#-llvmlinux-L.$xx#g" /Users/rmann/Projects/LFS/LLVMLinux/llvmlinux/targets/beaglebone/src/bbone/kernel/.config) ; \
	fi
(cd /Users/rmann/Projects/LFS/LLVMLinux/llvmlinux/targets/beaglebone/src/bbone/kernel && echo "" |  make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- oldconfig)
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
scripts/kconfig/conf.c:75:10: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
                printf(_("aborted!\n\n"));
                       ^~~~~~~~~~~~~~~~~
scripts/kconfig/lkc.h:36:17: note: expanded from macro '_'
#define _(text) gettext(text)
                ^~~~~~~~~~~~~
scripts/kconfig/conf.c:76:10: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
                printf(_("Console input/output is redirected. "));
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/kconfig/lkc.h:36:17: note: expanded from macro '_'
#define _(text) gettext(text)
                ^~~~~~~~~~~~~
scripts/kconfig/conf.c:77:10: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
                printf(_("Run 'make oldconfig' to update configuration.\n\n"));
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/kconfig/lkc.h:36:17: note: expanded from macro '_'
#define _(text) gettext(text)
                ^~~~~~~~~~~~~
scripts/kconfig/conf.c:87:10: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
                printf(_("(NEW) "));
                       ^~~~~~~~~~~
scripts/kconfig/lkc.h:36:17: note: expanded from macro '_'
#define _(text) gettext(text)
                ^~~~~~~~~~~~~
scripts/kconfig/conf.c:286:12: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
                                printf(_(" (NEW)"));
                                       ^~~~~~~~~~~
scripts/kconfig/lkc.h:36:17: note: expanded from macro '_'
#define _(text) gettext(text)
                ^~~~~~~~~~~~~
scripts/kconfig/conf.c:434:13: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
                                        printf(_("*\n* Restart config...\n*\n"));
                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/kconfig/lkc.h:36:17: note: expanded from macro '_'
#define _(text) gettext(text)
                ^~~~~~~~~~~~~
scripts/kconfig/conf.c:620:6: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
                                        _("\n*** The configuration requires explicit update.\n\n"));
                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/kconfig/lkc.h:36:17: note: expanded from macro '_'
#define _(text) gettext(text)
                ^~~~~~~~~~~~~
scripts/kconfig/conf.c:672:20: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
                        fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n"));
                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/kconfig/lkc.h:36:17: note: expanded from macro '_'
#define _(text) gettext(text)
                ^~~~~~~~~~~~~
scripts/kconfig/conf.c:676:20: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
                        fprintf(stderr, _("\n*** Error during update of the configuration.\n\n"));
                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/kconfig/lkc.h:36:17: note: expanded from macro '_'
#define _(text) gettext(text)
                ^~~~~~~~~~~~~
scripts/kconfig/conf.c:687:20: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
                        fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n"));
                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/kconfig/lkc.h:36:17: note: expanded from macro '_'
#define _(text) gettext(text)
                ^~~~~~~~~~~~~
10 warnings generated.
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf --oldconfig Kconfig
warning: (USB_MUSB_HDRC) selects TWL6030_USB which has unmet direct dependencies (USB_SUPPORT && (USB || USB_GADGET) && TWL4030_CORE && OMAP_USB2 && USB_MUSB_OMAP2PLUS)
warning: (DVB_USB_PCTV452E) selects TTPCI_EEPROM which has unmet direct dependencies (MEDIA_SUPPORT && MEDIA_PCI_SUPPORT && MEDIA_DIGITAL_TV_SUPPORT && I2C)
warning: (VIDEO_DM6446_CCDC && VIDEO_DM355_CCDC && VIDEO_ISIF && VIDEO_DM644X_VPBE) selects VIDEO_VPSS_SYSTEM which has unmet direct dependencies (MEDIA_SUPPORT && V4L_PLATFORM_DRIVERS && ARCH_DAVINCI)
*
* Restart config...
*
*
* USB Gadget Support
*
USB Gadget Support (USB_GADGET) [Y/n/m/?] y
  Debugging messages (DEVELOPMENT) (USB_GADGET_DEBUG) [Y/n/?] y
  Debugging information files (DEVELOPMENT) (USB_GADGET_DEBUG_FILES) [Y/n/?] y
  Debugging information files in debugfs (DEVELOPMENT) (USB_GADGET_DEBUG_FS) [Y/n/?] y
  Maximum VBUS Power usage (2-500 mA) (USB_GADGET_VBUS_DRAW) [2] 2
  Number of storage pipeline buffers (USB_GADGET_STORAGE_NUM_BUFFERS) [2] 2
  *
  * USB Peripheral Controller
  *
  Faraday FUSB300 USB Peripheral Controller (USB_FUSB300) [N/m/y/?] n
  Renesas R8A66597 USB Peripheral Controller (USB_R8A66597) [N/m/y/?] n
  Marvell USB2.0 Device Controller (USB_MV_UDC) [N/m/y/?] n
  Inventra HDRC USB Peripheral (TI, ADI, ...) (USB_GADGET_MUSB_HDRC) [Y/n/m/?] y
  Renesas M66592 USB Peripheral Controller (USB_M66592) [N/m/y/?] n
  PLX NET2272 (USB_NET2272) [N/m/y/?] n
  Dummy HCD (DEVELOPMENT) (USB_DUMMY_HCD) [N/m/y/?] n
  USB Gadget Drivers [M/y/?] m
    Gadget Zero (DEVELOPMENT) (USB_ZERO) [N/m/?] n
    Audio Gadget (USB_AUDIO) [N/m/?] n
    Ethernet Gadget (with CDC Ethernet support) (USB_ETH) [M/n/?] m
      RNDIS support (USB_ETH_RNDIS) [Y/n/?] y
      Ethernet Emulation Model (EEM) support (USB_ETH_EEM) [N/y/?] n
    Network Control Model (NCM) support (USB_G_NCM) [N/m/?] n
    Gadget Filesystem (USB_GADGETFS) [M/n/?] m
    Function Filesystem (USB_FUNCTIONFS) [N/m/?] n
    File-backed Storage Gadget (DEPRECATED) (USB_FILE_STORAGE) [N/m/?] n
    Mass Storage Gadget (USB_MASS_STORAGE) [M/n/?] m
    Serial Gadget (with CDC ACM and CDC OBEX support) (USB_G_SERIAL) [M/n/?] m
    MIDI Gadget (USB_MIDI_GADGET) [N/m/?] n
    Printer Gadget (USB_G_PRINTER) [N/m/?] n
    CDC Composite Device (Ethernet and ACM) (USB_CDC_COMPOSITE) [M/n/?] m
    Nokia composite gadget (USB_G_NOKIA) [N/m/?] n
    CDC Composite Device (ACM and mass storage) (USB_G_ACM_MS) [N/m/?] n
    Multifunction Composite Gadget (USB_G_MULTI) [M/n/?] m
      RNDIS + CDC Serial + Storage configuration (USB_G_MULTI_RNDIS) [Y/n/?] (NEW)       CDC Ethernet + CDC Serial + Storage configuration (USB_G_MULTI_CDC) [N/y/?] (NEW) 
Error in reading or end of file.
    HID Gadget (USB_G_HID) [M/n/?] m
    EHCI Debug Device Gadget (USB_G_DBGP) [N/m/?] n
    USB Webcam Gadget (USB_G_WEBCAM) [N/m/?] n
#
# configuration written to .config
#
---------------------------------------------------------------------
Finished state kernel-configure
---------------------------------------------------------------------
---------------------------------------------------------------------
Removing broken symbolic linked quilt patches for kernel...
---------------------------------------------------------------------
xargs: illegal option -- -
usage: xargs [-0opt] [-E eofstr] [-I replstr [-R replacements]] [-J replstr]
             [-L number] [-n number [-x]] [-P maxprocs] [-s size]
             [utility [argument ...]]
make[2]: *** [kernel-quilt-clean-broken-symlinks] Error 1
make[2]: `/Users/rmann/Projects/LFS/LLVMLinux/llvmlinux/targets/beaglebone/patches/series' is up to date.
---------------------------------------------------------------------
Building kernel with clang...
---------------------------------------------------------------------
(cd /Users/rmann/Projects/LFS/LLVMLinux/llvmlinux/targets/beaglebone/src/bbone/kernel &&  time  make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- -j9 CONFIG_DEBUG_INFO=1 CONFIG_DEBUG_SECTION_MISMATCH=y CONFIG_NO_ERROR_ON_MISMATCH=y -mcpu=cortex-a8  CC?="/Users/rmann/Projects/LFS/LLVMLinux/llvmlinux/toolchain/clang/install/bin/clang -gcc-toolchain /Users/rmann/Projects/LFS/LLVMLinux/llvmlinux/arch/arm/toolchain/codesourcery/arm-2013.05" uImage dtbs  )
/Applications/Xcode.app/Contents/Developer/usr/bin/make: invalid option -- c
/Applications/Xcode.app/Contents/Developer/usr/bin/make: invalid option -- u
/Applications/Xcode.app/Contents/Developer/usr/bin/make: invalid option -- =
/Applications/Xcode.app/Contents/Developer/usr/bin/make: invalid option -- c
Usage: make [options] [target] ...
Options:
  -b, -m                      Ignored for compatibility.
  -B, --always-make           Unconditionally make all targets.
  -C DIRECTORY, --directory=DIRECTORY
                              Change to DIRECTORY before doing anything.
  -d                          Print lots of debugging information.
  --debug[=FLAGS]             Print various types of debugging information.
  -e, --environment-overrides
                              Environment variables override makefiles.
  -f FILE, --file=FILE, --makefile=FILE
                              Read FILE as a makefile.
  -h, --help                  Print this message and exit.
  -i, --ignore-errors         Ignore errors from commands.
  -I DIRECTORY, --include-dir=DIRECTORY
                              Search DIRECTORY for included makefiles.
  -j [N], --jobs[=N]          Allow N jobs at once; infinite jobs with no arg.
  -k, --keep-going            Keep going when some targets can't be made.
  -l [N], --load-average[=N], --max-load[=N]
                              Don't start multiple jobs unless load is below N.
  -L, --check-symlink-times   Use the latest mtime between symlinks and target.
  -n, --just-print, --dry-run, --recon
                              Don't actually run any commands; just print them.
  -o FILE, --old-file=FILE, --assume-old=FILE
                              Consider FILE to be very old and don't remake it.
  -p, --print-data-base       Print make's internal database.
  -q, --question              Run no commands; exit status says if up to date.
  -r, --no-builtin-rules      Disable the built-in implicit rules.
  -R, --no-builtin-variables  Disable the built-in variable settings.
  -s, --silent, --quiet       Don't echo commands.
  -S, --no-keep-going, --stop
                              Turns off -k.
  -t, --touch                 Touch targets instead of remaking them.
  -v, --version               Print the version number of make and exit.
  -w, --print-directory       Print the current directory.
  --no-print-directory        Turn off -w, even if it was turned on implicitly.
  -W FILE, --what-if=FILE, --new-file=FILE, --assume-new=FILE
                              Consider FILE to be infinitely new.
  --warn-undefined-variables  Warn when an undefined variable is referenced.
  -N OPTION, --NeXT-option=OPTION
                              Turn on value of NeXT OPTION.

This program built for i386-apple-darwin11.3.0
Report bugs to <bug-make at gnu.org>

# Make data base, printed on Wed Nov  6 23:06:46 2013

# Variables

# command line
CONFIG_DEBUG_INFO = 1
# environment
EC2_HOME = /Users/rmann/Library/Amazon/EC2/Current
# environment
__CHECKFIX1436934 = 1
# environment
CLANG = /Users/rmann/Projects/LFS/LLVMLinux/llvmlinux/toolchain/clang/install/bin/clang
# environment
GRADLE_HOME = /usr/local/gradle/current
# environment
rvm_path = /Users/rmann/.rvm
# environment
SHELL = /bin/bash
# environment
V = 
# environment
_ = /usr/bin/make
# environment
HISTCONTROL = ignoredups:erasedups
# environment
_first = 0
# environment
DFLAGS = -Dddoc -odobj
# environment
EC2_URL = https://us-east-1.ec2.amazonaws.com
# command line
CONFIG_DEBUG_SECTION_MISMATCH = y
# environment
KM_HOME = /km
# environment
Apple_PubSub_Socket_Render = /tmp/launch-yTjHVT/Render
# environment
PATH = /Users/rmann/Projects/LFS/LLVMLinux/llvmlinux/arch/arm/toolchain/codesourcery/arm-2013.05/bin:/Users/rmann/Projects/LFS/LLVMLinux/llvmlinux/arch/arm/bin:/Users/rmann/Projects/LFS/LLVMLinux/llvmlinux/toolchain/clang/install/bin:/Users/rmann/bin:/Users/rmann/.rvm/bin:/DeveloperAdditions/Java/Ant/bin:/Library/ANTLR/bin:/usr/local/acl:/usr/local/mysql/bin:/usr/local/gputils/bin:/usr/local/dfu/bin:/usr/local/sam7utils/bin:/usr/local/git/bin:/usr/local/sbin:/Library/Frameworks/Python.framework/Versions/Current/bin:/usr/local/gradle/current/bin:/usr/local/maven/current/bin:/Users/rmann/Library/Amazon/EC2/Current/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/usr/local/CrossPack-AVR/bin:/usr/local/sbin:/Library/Frameworks/Python.framework/Versions/Current/bin:/usr/local/gradle/current/bin:/usr/local/maven/current/bin:/Users/rmann/Library/Amazon/EC2/Current/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/usr/local/CrossPack-AVR/bin:/Users/rmann/Projects/LFS/LLVMLinux/llvmlinux/arch/all/bin:/Users/rmann/Projects/LFS/LLVMLinux/llvmlinux/tools
# environment
EC2_CERT = ~/.ec2/cert-WCP3V636BAAVL7VUHDYYLKB7TJ3RJKS7.pem
# default
.FEATURES := target-specific order-only second-expansion else-if archives jobserver check-symlink
# environment
SSH_AUTH_SOCK = /tmp/launch-WMSeIx/Listeners
# environment
DISPLAY = /tmp/launch-ZwWXKp/org.macosforge.xquartz:0
# environment
HISTFILESIZE = 4000
# environment
HOME = /Users/rmann
# environment
rvm_bin_path = /Users/rmann/.rvm/bin
# environment
PWD = /Users/rmann/Projects/LFS/LLVMLinux/llvmlinux/targets/beaglebone/src/bbone/kernel
# environment
ANT_HOME = /DeveloperAdditions/Java/Ant
# environment
MANPATH = /usr/local/man::/usr/local/CrossPack-AVR/man
# environment
TIME = ---------------------------------------------------------------------\n Build Time\n ---------------------------------------------------------------------\n User time (seconds): %U\n System time (seconds): %S\n Percent of CPU this job got: %P\n Elapsed (wall clock) time (h:mm:ss or m:ss): %E\n Maximum resident set size (kbytes): %M\n Major (requiring I/O) page faults: %F\n Minor (reclaiming a frame) page faults: %R\n Voluntary context switches: %w\n Involuntary context switches: %c\n Command being timed: "%C"\n Swaps: %W\n File system inputs: %I\n File system outputs: %O\n Page size (bytes): %Z\n Exit status: %x
# environment
LOGNAME = rmann
# environment
EC2_PRIVATE_KEY = ~/.ec2/pk-WCP3V636BAAVL7VUHDYYLKB7TJ3RJKS7.pem
# environment
M2_HOME = /usr/local/maven/current
# default
MAKECMDGOALS := uImage dtbs
# environment
SHLVL = 2
# command line
CONFIG_NO_ERROR_ON_MISMATCH = y
# environment
RSYNC_RSH = /usr/bin/ssh
# command line
CC = /Users/rmann/Projects/LFS/LLVMLinux/llvmlinux/toolchain/clang/install/bin/clang -gcc-toolchain /Users/rmann/Projects/LFS/LLVMLinux/llvmlinux/arch/arm/toolchain/codesourcery/arm-2013.05
# environment
JAVA_HOME = /Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home
# environment
USER = rmann
# environment
TERM_SESSION_ID = 3B15142B-7EC0-429A-971C-950A205E9EDF
# environment
rvm_version = 1.14.6 (stable)
# environment
OLDPWD = /Users/rmann/Projects/LFS/LLVMLinux/llvmlinux/targets/beaglebone
# environment
TERM_PROGRAM = Apple_Terminal
# default
.VARIABLES := 
# environment
TMPDIR = /Users/rmann/Projects/LFS/LLVMLinux/llvmlinux/targets/beaglebone/tmp
# environment
PYTHONPATH = /usr/local/lib/python2.7/site-packages:
# command line
ARCH = arm
# environment
MAKEFLAGS = 
# environment
MFLAGS = 
# environment
TERM_PROGRAM_VERSION = 326
# environment
P4CONFIG = .p4config
# environment
ANTLR_HOME = /Library/ANTLR
# environment
__array_start = 0
# command line
CROSS_COMPILE = arm-none-linux-gnueabi-
# environment
__CF_USER_TEXT_ENCODING = 0x1F5:0:0
# environment
RESIN_HOME = /Library/Resin/current
# environment
EDITOR = edit -w --resume +1
# environment
escape_flag = 1
# environment
REFREPO = /Users/rmann/Projects/LFS/LLVMLinux/llvmlinux/arch/all/kernel.git
# environment
SECURITYSESSIONID = 1876a
# environment
GRADLE_OPTS = -Dfile.encoding=UTF-8
# environment
rvm_prefix = /Users/rmann
# environment
HISTSIZE = 4000
# environment
GREP_OPTIONS = --binary-files=without-match --exclude=tags
# environment
_second = 1
# environment
MAKELEVEL = 1
# environment
MAVEN_OPTS = -Dfile.encoding=UTF-8
# environment
LANG = en_US.UTF-8
# environment
TERM = xterm-256color
# environment
LLVM_HOME = /usr/local/llvm
# variable set hash-table stats:
# Load=69/1024=7%, Rehash=0, Collisions=3/80=4%

# Pattern-specific Variable Values

# No pattern-specific variable values.

# Directories


# No files, no impossibilities in 0 directories.

# Implicit Rules

# No implicit rules.

# Files

# Not a target:
uImage:
#  Command-line target.
#  Implicit rule search has not been done.
#  Modification time never checked.
#  File has not been updated.

# Not a target:
dtbs:
#  Command-line target.
#  Implicit rule search has not been done.
#  Modification time never checked.
#  File has not been updated.

# files hash-table stats:
# Load=2/1024=0%, Rehash=0, Collisions=0/2=0%
# VPATH Search Paths

# No `vpath' search paths.

# No general (`VPATH' variable) search path.

# # of strings in strcache: 0
# # of strcache buffers: 0
# strcache size: total = 0 / max = 0 / min = 4096 / avg = 0
# strcache free: total = 0 / max = 0 / min = 4096 / avg = 0

# Finished Make data base on Wed Nov  6 23:06:46 2013


real	0m0.004s
user	0m0.002s
sys	0m0.002s
make: *** [state/kernel-build] Error 2


-- 
Rick



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 204 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.linuxfoundation.org/pipermail/llvmlinux/attachments/20131107/e0a9f11e/attachment.sig>


More information about the LLVMLinux mailing list