[LLVMdev] install and the strip command

991 views
Skip to first unread message

reed kotler

unread,
Feb 26, 2014, 7:36:07 PM2/26/14
to LLV...@cs.uiuc.edu
Trying to do a "make install" on a mips box .

llvm[2]: Installing Release+Asserts Archive Library
/home/rkotler/caviumllvmwclang/install/lib/libLLVMLineEditor.a
make[2]: Leaving directory
`/home/rkotler/caviumllvmwclang/build/lib/LineEditor'
make[1]: Leaving directory `/home/rkotler/caviumllvmwclang/build/lib'
make[1]: Entering directory
`/home/rkotler/caviumllvmwclang/build/tools/llvm-config'
llvm[1]: Installing llvm-config-host
strip: Unable to recognise the format of the input file
`/home/rkotler/caviumllvmwclang/install/bin/llvm-config-host'
/usr/bin/install: strip process terminated abnormally
make[1]: *** [install] Error 1
make[1]: Leaving directory
`/home/rkotler/caviumllvmwclang/build/tools/llvm-config'
make: *** [install] Error 1


I can provide another strip but I don' think that we have a way to
control the install command to use it.

Any ideas?

Tia.

Reed
_______________________________________________
LLVM Developers mailing list
LLV...@cs.uiuc.edu http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

Simon Atanasyan

unread,
Feb 27, 2014, 12:05:25 AM2/27/14
to reed kotler, LLV...@cs.uiuc.edu
Hi,

On Thu, Feb 27, 2014 at 4:36 AM, reed kotler <rko...@mips.com> wrote:
> Trying to do a "make install" on a mips box .
>
> llvm[2]: Installing Release+Asserts Archive Library
> /home/rkotler/caviumllvmwclang/install/lib/libLLVMLineEditor.a
> make[2]: Leaving directory
> `/home/rkotler/caviumllvmwclang/build/lib/LineEditor'
> make[1]: Leaving directory `/home/rkotler/caviumllvmwclang/build/lib'
> make[1]: Entering directory
> `/home/rkotler/caviumllvmwclang/build/tools/llvm-config'
> llvm[1]: Installing llvm-config-host
> strip: Unable to recognise the format of the input file
> `/home/rkotler/caviumllvmwclang/install/bin/llvm-config-host'
> /usr/bin/install: strip process terminated abnormally
> make[1]: *** [install] Error 1
> make[1]: Leaving directory
> `/home/rkotler/caviumllvmwclang/build/tools/llvm-config'
> make: *** [install] Error 1
>
>
> I can provide another strip but I don' think that we have a way to control
> the install command to use it.

It's a known problem. See r142997 and r143009. And this discussion:
http://llvm.1065342.n5.nabble.com/The-make-install-fails-in-cross-compile-mode-td23139.html

Install tool invokes strip. GNU install allows to configure which
strip to use (--strip-program). In general (for example on FreeBSD) it
is not possible and install always runs just 'strip'. In case of
cross-compilation that leads to the error.

The workaround, I hope it still works, is to keep symbols:
KEEP_SYMBOLS=1 make install

--
Simon

Richard Pennington

unread,
Feb 27, 2014, 6:57:08 AM2/27/14
to Simon Atanasyan, LLV...@cs.uiuc.edu, reed kotler
Another workaround is to configure with --enable-keep-symbols.

I had to chuckle when I read the discussion you pointed to. Reed was in it.

-Rich

Ed Maste

unread,
Feb 27, 2014, 8:53:20 AM2/27/14
to Simon Atanasyan, LLV...@cs.uiuc.edu, reed kotler
On 27 February 2014 00:05, Simon Atanasyan <si...@atanasyan.com> wrote:
>
> Install tool invokes strip. GNU install allows to configure which
> strip to use (--strip-program). In general (for example on FreeBSD) it
> is not possible and install always runs just 'strip'. In case of
> cross-compilation that leads to the error.

Actually it is possible on FreeBSD -- from install(1):

ENVIRONMENT
The install utility checks for the presence of the STRIPBIN environment
variable and if present, uses the assigned value as the program to run if
and when the -s option has been specified.

I'm not aware of other BSDs having this though, and supporting a
collection of command options and environment settings on various
platforms seems like it would be rather awkward.

However, FreeBSD will likely soon migrate to strip, nm, size and such
from the elftoolchain project, and those tools are natively cross-arch
so strip should just work for this case.

Joerg Sonnenberger

unread,
Feb 27, 2014, 9:19:25 AM2/27/14
to llv...@cs.uiuc.edu
On Thu, Feb 27, 2014 at 08:53:20AM -0500, Ed Maste wrote:
> On 27 February 2014 00:05, Simon Atanasyan <si...@atanasyan.com> wrote:
> >
> > Install tool invokes strip. GNU install allows to configure which
> > strip to use (--strip-program). In general (for example on FreeBSD) it
> > is not possible and install always runs just 'strip'. In case of
> > cross-compilation that leads to the error.
>
> Actually it is possible on FreeBSD -- from install(1):
>
> ENVIRONMENT
> The install utility checks for the presence of the STRIPBIN environment
> variable and if present, uses the assigned value as the program to run if
> and when the -s option has been specified.
>
> I'm not aware of other BSDs having this though, and supporting a
> collection of command options and environment settings on various
> platforms seems like it would be rather awkward.

For NetBSD, it is STRIP.

Joerg

Reed Kotler

unread,
Feb 27, 2014, 2:50:01 PM2/27/14
to llv...@cs.uiuc.edu
The problem seems to be the executable

llvm-config-host

this is the wrong file type for the machine that I'm on.

I'm building a hosted mips clang/llvm compiler, starting by compiling
llvm with clang/llvm on x86 producing a mips executable.

The question then is where to run install.

If I run install on the mips target, then file llvm-config-host is an
x86 executable so strip will fail.

../install/bin/llvm-config-host: ELF 64-bit LSB executable, x86-64,
version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux
2.6.24, BuildID[sha1]=0x64e37bd56c1edc16be1447ec301bfce3f207477d, not
stripped
rkotler@mipsswbrd006-le:~/caviumllvmwclang/build$


If I tried to do the install on the host, there would be a bigger
problem because then strip would fail on every other executable.


So the main problem is that install should not be trying to strip
rkotler@mipsswbrd006-le:~/caviumllvmwclang/build$ which strip
/usr/bin/strip
rkotler@mipsswbrd006-le:~/caviumllvmwclang/build$

Perhaps I just need to delete that file from the build directory.

Reed Kotler

unread,
Feb 27, 2014, 2:57:00 PM2/27/14
to llv...@cs.uiuc.edu
All the tools in

./BuildTools/Release+Asserts/bin/

Are host tools. Since I'm not doing the make install on the target, then
strip does not know about these.

It knows enough to install these as
xxx-host

but not enough to not call strip.


On 02/27/2014 06:19 AM, Joerg Sonnenberger wrote:

Reed Kotler

unread,
Feb 27, 2014, 3:45:28 PM2/27/14
to llv...@cs.uiuc.edu
So I guess the question is: how do you do the make install?

I'm rebuilding right now with --enable-keep-symbols and then perhaps it
can be installed on either the host or target.

It's always possible to later strip the binaries in the installed bin
directory.

Reed Kotler

unread,
Feb 27, 2014, 4:04:50 PM2/27/14
to llv...@cs.uiuc.edu
so if i configure with --enable-keep-symbols

then a "make install" on the host works but not on the target.

the resulting directory structure will be fine.

Reed Kotler

unread,
Feb 27, 2014, 5:00:06 PM2/27/14
to llv...@cs.uiuc.edu
On 02/27/2014 01:04 PM, Reed Kotler wrote:
> so if i configure with --enable-keep-symbols
>
> then a "make install" on the host works but not on the target.
>
> the resulting directory structure will be fine.
>
>
It would be better if "make install" worked on the target (also).

In this case, I'm using NFS mounted systems out of my home directory so
it's easy to finesse this.

Otherwise I'd have to make a root files system to get something I could
install on the target.

In this case I need to strip the executables manually, if desired, after
the actual install, on the target.
Reply all
Reply to author
Forward
0 new messages