jimtcl fails with stdlib.h not found #54

Open
ksjogo opened this Issue Mar 1, 2013 · 12 comments

5 participants

@ksjogo

Summoning fails for me:
=== configuring in jimtcl (/Users/ksjogo/arm/summon-arm-toolchain/build/jimtcl)
configure: running /bin/sh ../../openocd-0.6.1/jimtcl/configure.gnu --disable-option-checking '--prefix=/Users/ksjogo/sat' '--enable-maintainer-mode' '--disable-werror' '--enable-dummy' '--enable-ft2232_libftdi' '--enable-usb_blaster_libftdi' '--enable-ep93xx' '--enable-at91rm9200' '--enable-presto_libftdi' '--enable-usbprog' '--enable-jlink' '--enable-vsllink' '--enable-rlink' '--enable-arm-jtag-ew' '--enable-stlink' 'CFLAGS= -I/opt/mine/include -I/usr/local/include' 'LDFLAGS= -L/opt/mine/lib -L/usr/local/lib' --cache-file=/dev/null --srcdir=../../openocd-0.6.1/jimtcl
Host System...x86_64-apple-darwin11.4.2
Build System...x86_64-apple-darwin11.4.2
C compiler... cc -I/opt/mine/include -I/usr/local/include
C++ compiler... c++ -I/opt/mine/include -I/usr/local/include
Build C compiler...cc
Checking for stdlib.h...not found
Error: Compiler does not work. See config.log
Try: 'configure --help' for options
configure: error: ../../openocd-0.6.1/jimtcl/configure.gnu failed for jimtcl

Anyone to fix this?
What are the /opt/mine/lib parts? They are hardcoded in the script but not present on everyones mac.

@jhgorse

The /opt/mine/lib parts seem to be from an SVN include somewhere for OOCD... not sure it ought to be there. Nevertheless, it's not likely your issue though I removed it from my version.

Here's what I have found so far...

Open: summon-arm-toolchain/openocd-0.6.1/jimtcl/autosetup/cc.tcl
Commented out what was line 499 for me

        switch -glob -- [get-define host] {
                *-*-darwin* {
                        # Don't generate .dSYM directories
#                       lappend cmdline -gstabs
                }
        }
        lappend cmdline $src -o $tmp {*}$opts(-libs)

-gstabs is a gcc-only option which does not exist for llvm variants of cc, so we are disabling this Darwin-only linker thing from Autosetup. This only seems to work if you configure/build jimtcl manually.

@msteveb

You are building on darwin, targetting darwin.

Host System...x86_64-apple-darwin11.4.2
Build System...x86_64-apple-darwin11.4.2

Which cc are you using? It should support -gstabs.
Check your $PATH?
Can you provide config.log?

@ksjogo

CC -v
Apple LLVM version 4.2 (clang-425.0.27) (based on LLVM 3.2svn)
Target: x86_64-apple-darwin11.4.2
Thread model: posix

What does need to be in the path?

@msteveb

I wonder if you are pulling in cc from somewhere else, not the host cc. Can you provide the config.log?

@rbarris

It looks like clang doesn't support -gstabs, but llvm-gcc does. So if your CC points to clang, it's no go.

nv-rbarris-mbp:~ rbarris$ CC -v
Apple LLVM version 4.2 (clang-425.0.27) (based on LLVM 3.2svn)
Target: x86_64-apple-darwin12.2.0
Thread model: posix

nv-rbarris-mbp:~ rbarris$ CC -gstabs
clang: error: unsupported option '-gstabs'
clang: error: no input files

nv-rbarris-mbp:~ rbarris$ llvm-gcc --version -gstabs
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

nv-rbarris-mbp:~ rbarris$ llvm-gcc -gstabs
i686-apple-darwin11-llvm-gcc-4.2: no input files

@msteveb

Not sure why you are testing CC (the C++ compiler). Test cc (the C compiler) instead.

@rbarris

Same really - 'cc' maps to clang by default, and clang doesn't support gstabs. This is Xcode 4.6.1 with the latest command line tools package.

nv-rbarris-mbp:~ rbarris$ which cc
/usr/bin/cc

nv-rbarris-mbp:~ rbarris$ cc --version
Apple LLVM version 4.2 (clang-425.0.27) (based on LLVM 3.2svn)
Target: x86_64-apple-darwin12.2.0
Thread model: posix

nv-rbarris-mbp:~ rbarris$ cc -gstabs
clang: error: unsupported option '-gstabs'
clang: error: no input files

@msteveb

OK. This must be a recent change. I'll come up with a check for this.

@ksjogo

The patch works.

@Tylerflick

I'm still running into this issue with the patch applied.

@msteveb

@Tylerflick you will need to provide your config.log if you want me to investigate this further

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment