icecc-create-env: Upgrade script
PATCH 1/1 icecc-create-env: Upgrade script
Folks,
This change was necessary to compile code with external toolchains with support for linker time optimization, such as linaro. The older script does not process the LTO related content correctly. More recent scripts from upstream icecream corrects this error. However, the script required modifications for use with OE. Hence I created this patch.
Iyad Qumei (1):
icecc-create-env: Upgrade script
.../icecc-create-env-native/icecc-create-env | 266 +++++++++++++++-----
...ive_0.1.bb => icecc-create-env-native_1.0.1.bb} | 5 +-
2 files changed, 209 insertions(+), 62 deletions(-)
rename meta/recipes-devtools/icecc-create-env/{icecc-create-env-native_0.1.bb => icecc-create-env-native_1.0.1.bb} (89%)Signature · 1 line
1.7.10.4
PATCH 1/1 icecc-create-env: Upgrade script
The original icecc script does not handle toolchain content properly, resulting in build failures, such as
gxx: fatal error: -fuse-linker-plugin, but liblto_plugin.so not found
This patch brings in the latest script form the icecream source, and modifies it for use in the OE build environment. The change was tested with OE-Core built toolchain, and external toolchain.
---
.../icecc-create-env-native/icecc-create-env | 266 +++++++++++++++-----
...ive_0.1.bb => icecc-create-env-native_1.0.1.bb} | 5 +-
2 files changed, 209 insertions(+), 62 deletions(-)
rename meta/recipes-devtools/icecc-create-env/{icecc-create-env-native_0.1.bb => icecc-create-env-native_1.0.1.bb} (89%)meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +208 -58
@@ -24,12 +24,12 @@ add_file () fi test -z "$name" && return # ls -H isn't really the same as readlink, but - # readlink is not portable enough. + # readlink is not portable enough. path=`ls -H $path` toadd="$name=$path" is_contained "$toadd" && return if test -z "$silent"; then - echo "adding file $toadd" + echo "adding file $toadd" fi target_files="$target_files $toadd" if test -x "$path"; then
@@ -43,19 +43,81 @@ add_file () # libc.so.6 => /lib/tls/libc.so.6 (0xb7e81000) # /lib/ld-linux.so.2 (0xb7fe8000) # covering both situations ( with => and without ) - for lib in `ldd "$path" | sed -n 's,^[^/]*\(/[^ ]*\).*,\1,p'`; do - test -f "$lib" || continue - # Check wether the same library also exists in the parent directory, - # and prefer that on the assumption that it is a more generic one. - local baselib=`echo "$lib" | sed 's,\(/[^/]*\)/.*\(/[^/]*\)$,\1\2,'` - test -f "$baselib" && lib=$baselib - add_file "$lib" - done - fi + for lib in `ldd "$path" | sed -n 's,^[^/]*\(/[^ ]*\).*,\1,p'`; do + test -f "$lib" || continue + # Check wether the same library also exists in the parent directory, + # and prefer that on the assumption that it is a more generic one. + local baselib=`echo "$lib" | sed 's,\(/[^/]*\)/.*\(/[^/]*\)$,\1\2,'` + test -f "$baselib" && lib=$baselib + add_file "$lib" + done + fi fi fi } +# returns abs path to filedir +abs_path() +{ + local path=$1 + if test -f "$path"; then + pushd $(dirname $path) > /dev/null 2>&1 + dir_path=`pwd -P` + path=$dir_path/$(basename $path) + popd > /dev/null 2>&1 + elif test -d "$path"; then + pushd $path > /dev/null 2>&1 + path=`pwd -P` + popd > /dev/null 2>&1 + fi + echo $path +} + +# Search and add file to the tarball file. +search_addfile() +{ + local compiler=$1 + local file_name=$2 + local file_installdir=$3 + local file="" + + file=$($compiler -print-prog-name=$file_name) + + if test -z "$file" || test "$file" = "$file_name" || ! test -e "$file"; then + file=`$compiler -print-file-name=$file_name` + fi + + if ! test -e "$file"; then + return 1 + fi + + if test -z "$file_installdir"; then + # The file is going to be added to the tarball + # in the same path where the compiler found it. + + file_installdir=$(dirname $file) + abs_installdir=$(abs_path $file_installdir) + + if test "$file_installdir" != "$abs_installdir"; then + # The path where the compiler found the file is relative! + # If the path where the compiler found the file is relative + # to compiler's path, we must change it to be relative to + # /usr/bin path where the compiler is going to be installed + # in the tarball file. + # Replacing relative path by abs path because the tar command + # used to create the tarball file doesn't work well with + # relative path as installdir. + + compiler_basedir=$(abs_path ${compiler%/*/*}) + file_installdir=${abs_installdir/$compiler_basedir/"/usr"} + fi + fi + + add_file "$file" "$file_installdir/$file_name" + + return 0 +} + # backward compat if test "$1" = "--respect-path"; then shift
@@ -67,64 +129,151 @@ if test "$1" = "--silent"; then shift fi - -added_gcc=$1 -shift -added_gxx=$1 -shift -added_as=$1 -shift -archive_name=$1 - -if test -z "$added_gcc" || test -z "$added_gxx" ; then - echo "usage: $0 <gcc_path> <g++_path>" - exit 1 +if test "$1" != "--gcc" -a "$1" != "--clang"; then + # backward compat + added_gcc=$1 + shift + added_gxx=$1 + shift + added_as=$1 + shift + archive_name=$1 + shift + gcc=1 +else + if test "$1" = "--gcc"; then + shift + added_gcc=$1 + shift + added_gxx=$1 + shift + added_as=$1 + shift + archive_name=$1 + shift + gcc=1 + elif test "$1" = "--clang"; then + shift + added_clang=$1 + shift + added_compilerwrapper=$1 + shift + clang=1 + else + usage + exit 1 + fi fi -if ! test -x "$added_gcc" ; then - echo "'$added_gcc' is no executable." - exit 1 +if test -n "$gcc"; then + if test -z "$added_gcc" || test -z "$added_gxx"; then + usage + exit 1 + fi + if ! test -x "$added_gcc" ; then + echo "'$added_gcc' is no executable." + exit 1 + fi + if ! test -x "$added_gxx" ; then + echo "'$added_gxx' is no executable." + exit 1 + fi + if test -z "$added_as" ; then + add_file /usr/bin/as /usr/bin/as + else + if ! test -x "$added_as" ; then + echo "'$added_as' is no executable." + exit 1 + fi + add_file $added_as /usr/bin/as + fi fi -if ! test -x "$added_gxx" ; then - echo "'$added_gcc' is no executable." - exit 1 +if test -n "$clang"; then + if ! test -x "$added_clang" ; then + echo "'$added_clang' is no executable." + exit 1 + fi + if ! test -x "$added_compilerwrapper" ; then + echo "'$added_compilerwrapper' is no executable." + exit 1 + fi fi +extrafiles= +while test "x$1" = "x--addfile"; do + shift + extrafiles="$extrafiles $1" + shift +done +tempdir=`mktemp -d /tmp/iceccenvXXXXXX` -add_file $added_gcc /usr/bin/gcc -add_file $added_gxx /usr/bin/g++ +# for testing the environment is usable at all +add_file /bin/true -if test -z "$added_as" ; then - add_file /usr/bin/as /usr/bin/as -else - if ! test -x "$added_as" ; then - echo "'$added_as' is no executable." - exit 1 - fi +if test -n "$gcc"; then + # getting compilers abs path + added_gcc=$(abs_path $added_gcc) + added_gxx=$(abs_path $added_gxx) - add_file $added_as /usr/bin/as -fi + if test -z "$clang"; then + add_file $added_gcc /usr/bin/gcc + add_file $added_gxx /usr/bin/g++ + else + # HACK: The clang case below will add a wrapper in place of gcc, so add the real + # gcc under a different name that the wrapper will call. + add_file $added_gcc /usr/bin/gcc.bin + add_file $added_gxx /usr/bin/g++.bin + fi + add_file `$added_gcc -print-prog-name=cc1` /usr/bin/cc1 + add_file `$added_gxx -print-prog-name=cc1plus` /usr/bin/cc1plus + + gcc_as=$($added_gcc -print-prog-name=as) + if test "$gcc_as" = "as"; then + add_file /usr/bin/as + else + add_file "$gcc_as" /usr/bin/as + fi -add_file `$added_gcc -print-prog-name=cc1` /usr/bin/cc1 -add_file `$added_gxx -print-prog-name=cc1plus` /usr/bin/cc1plus -specfile=`$added_gcc -print-file-name=specs` -if test -n "$specfile" && test -e "$specfile"; then - add_file "$specfile" + search_addfile $added_gcc specs + search_addfile $added_gcc liblto_plugin.so fi -ltofile=`$added_gcc -print-prog-name=lto1` -pluginfile="${ltofile%lto1}liblto_plugin.so" -if test -r "$pluginfile" -then - add_file $pluginfile ${pluginfile#*usr} - add_file $pluginfile /usr${pluginfile#*usr} +if test -n "$clang"; then + add_file $added_clang /usr/bin/clang + # HACK: Older icecream remotes have /usr/bin/{gcc|g++} hardcoded and wouldn't + # call /usr/bin/clang at all. So include a wrapper binary that will call gcc or clang + # depending on an extra argument added by icecream. + add_file $added_compilerwrapper /usr/bin/gcc + add_file $added_compilerwrapper /usr/bin/g++ + + add_file $($added_clang -print-prog-name=as) /usr/bin/as + + # clang always uses its internal .h files + clangincludes=$(dirname $($added_clang -print-file-name=include/limits.h)) + clangprefix=$(dirname $(dirname $added_clang)) + for file in $(find $clangincludes -type f); do + # get path without .. + destfile=$(readlink -e $file) + # and convert from <prefix> to /usr if needed + destfile=$(echo $destfile | sed "s#$clangprefix#/usr#" ) + add_file "$file" "$destfile" + done fi -tempdir=`mktemp -d /tmp/iceccenvXXXXXX` +for extrafile in $extrafiles; do + add_file $extrafile +done + +# IKLQ ? +# special case for weird multilib setups +for dir in /lib /lib64 /usr/lib /usr/lib64; do + test -L $dir && cp -p $dir $tempdir$dir +done + new_target_files= -for i in $target_files; do +for i in $target_files; do case $i in *=/*) target=`echo $i | cut -d= -f1`
@@ -151,11 +300,11 @@ target_files=`for i in $new_target_files; do echo $i; done | sort` #if not use the md5 of all files as the archive name if test -z "$archive_name"; then md5sum=NONE - for file in /usr/bin/md5sum /bin/md5 /usr/bin/md5; do - if test -x $file; then - md5sum=$file - break - fi + for file in /usr/bin/md5sum /bin/md5 /usr/bin/md5 /sbin/md5; do + if test -x $file; then + md5sum=$file + break + fi done #calculate md5 and use it as the archive name
@@ -190,3 +339,4 @@ tar -czhf "$mydir/$archive_name" $target_files || { } cd .. rm -rf $tempdir +
meta/recipes-devtools/icecc-create-env/icecc-create-env-native_1.0.1.bb renamed from meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb +1 -4
@@ -6,16 +6,13 @@ SECTION = "base" LICENSE = "GPLv2+" LIC_FILES_CHKSUM = "file://icecc-create-env;beginline=2;endline=5;md5=ae1df3d6a058bfda40b66094c5f6065f" -PR = "r2" +PR = "r0" DEPENDS = "" INHIBIT_DEFAULT_DEPS = "1" -FILESPATH = "${FILE_DIRNAME}/${PN}/" - inherit native -PATCHTOOL = "patch" SRC_URI = "file://icecc-create-env" S = "${WORKDIR}"
Signature · 1 line
1.7.10.4
Martin Jansa
NAKQuoted 9 lines · Iyad Qumei
The original icecc script does not handle toolchain content properly, resulting in build failures, such as
gxx: fatal error: -fuse-linker-plugin, but liblto_plugin.so not found
This patch brings in the latest script form the icecream source, and modifies it for use in the OE build environment. The change was tested with OE-Core built toolchain, and external toolchain.
Quoted 6 lines
Signed-off-by Iyad Qumei <[email protected]>--- .../icecc-create-env-native/icecc-create-env | 266 +++++++++++++++----- ...ive_0.1.bb => icecc-create-env-native_1.0.1.bb} | 5 +- 2 files changed, 209 insertions(+), 62 deletions(-) rename meta/recipes-devtools/icecc-create-env/{icecc-create-env-native_0.1.bb => icecc-create-env-native_1.0.1.bb} (89%)
NACK
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env add_file () · line 27
Quoted 11 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +1
-1@@ -24,12 +24,12 @@ add_file () fi test -z "$name" && return # ls -H isn't really the same as readlink, but - # readlink is not portable enough. + # readlink is not portable enough.
Don't introduce trailing whitespaces
Quoted 21 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +1
-9path=`ls -H $path` toadd="$name=$path" is_contained "$toadd" && return if test -z "$silent"; then - echo "adding file $toadd" + echo "adding file $toadd" fi target_files="$target_files $toadd" if test -x "$path"; then@@ -43,19 +43,81 @@ add_file () # libc.so.6 => /lib/tls/libc.so.6 (0xb7e81000) # /lib/ld-linux.so.2 (0xb7fe8000) # covering both situations ( with => and without ) - for lib in `ldd "$path" | sed -n 's,^[^/]*\(/[^ ]*\).*,\1,p'`; do - test -f "$lib" || continue - # Check wether the same library also exists in the parent directory, - # and prefer that on the assumption that it is a more generic one. - local baselib=`echo "$lib" | sed 's,\(/[^/]*\)/.*\(/[^/]*\)$,\1\2,'` - test -f "$baselib" && lib=$baselib - add_file "$lib" - done
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env add_file () · line 54
Quoted 10 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +9
-1- fi + for lib in `ldd "$path" | sed -n 's,^[^/]*\(/[^ ]*\).*,\1,p'`; do + test -f "$lib" || continue + # Check wether the same library also exists in the parent directory, + # and prefer that on the assumption that it is a more generic one. + local baselib=`echo "$lib" | sed 's,\(/[^/]*\)/.*\(/[^/]*\)$,\1\2,'` + test -f "$baselib" && lib=$baselib + add_file "$lib" + done + fi
Don't mix tabs and spaces.
Quoted 250 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +183
-41fi fi } +# returns abs path to filedir +abs_path() +{ + local path=$1 + if test -f "$path"; then + pushd $(dirname $path) > /dev/null 2>&1 + dir_path=`pwd -P` + path=$dir_path/$(basename $path) + popd > /dev/null 2>&1 + elif test -d "$path"; then + pushd $path > /dev/null 2>&1 + path=`pwd -P` + popd > /dev/null 2>&1 + fi + echo $path +} + +# Search and add file to the tarball file. +search_addfile() +{ + local compiler=$1 + local file_name=$2 + local file_installdir=$3 + local file="" + + file=$($compiler -print-prog-name=$file_name) + + if test -z "$file" || test "$file" = "$file_name" || ! test -e "$file"; then + file=`$compiler -print-file-name=$file_name` + fi + + if ! test -e "$file"; then + return 1 + fi + + if test -z "$file_installdir"; then + # The file is going to be added to the tarball + # in the same path where the compiler found it. + + file_installdir=$(dirname $file) + abs_installdir=$(abs_path $file_installdir) + + if test "$file_installdir" != "$abs_installdir"; then + # The path where the compiler found the file is relative! + # If the path where the compiler found the file is relative + # to compiler's path, we must change it to be relative to + # /usr/bin path where the compiler is going to be installed + # in the tarball file. + # Replacing relative path by abs path because the tar command + # used to create the tarball file doesn't work well with + # relative path as installdir. + + compiler_basedir=$(abs_path ${compiler%/*/*}) + file_installdir=${abs_installdir/$compiler_basedir/"/usr"} + fi + fi + + add_file "$file" "$file_installdir/$file_name" + + return 0 +} + # backward compat if test "$1" = "--respect-path"; then shift@@ -67,64 +129,151 @@ if test "$1" = "--silent"; then shift fi - -added_gcc=$1 -shift -added_gxx=$1 -shift -added_as=$1 -shift -archive_name=$1 - -if test -z "$added_gcc" || test -z "$added_gxx" ; then - echo "usage: $0 <gcc_path> <g++_path>" - exit 1 +if test "$1" != "--gcc" -a "$1" != "--clang"; then + # backward compat + added_gcc=$1 + shift + added_gxx=$1 + shift + added_as=$1 + shift + archive_name=$1 + shift + gcc=1 +else + if test "$1" = "--gcc"; then + shift + added_gcc=$1 + shift + added_gxx=$1 + shift + added_as=$1 + shift + archive_name=$1 + shift + gcc=1 + elif test "$1" = "--clang"; then + shift + added_clang=$1 + shift + added_compilerwrapper=$1 + shift + clang=1 + else + usage + exit 1 + fi fi -if ! test -x "$added_gcc" ; then - echo "'$added_gcc' is no executable." - exit 1 +if test -n "$gcc"; then + if test -z "$added_gcc" || test -z "$added_gxx"; then + usage + exit 1 + fi + if ! test -x "$added_gcc" ; then + echo "'$added_gcc' is no executable." + exit 1 + fi + if ! test -x "$added_gxx" ; then + echo "'$added_gxx' is no executable." + exit 1 + fi + if test -z "$added_as" ; then + add_file /usr/bin/as /usr/bin/as + else + if ! test -x "$added_as" ; then + echo "'$added_as' is no executable." + exit 1 + fi + add_file $added_as /usr/bin/as + fi fi -if ! test -x "$added_gxx" ; then - echo "'$added_gcc' is no executable." - exit 1 +if test -n "$clang"; then + if ! test -x "$added_clang" ; then + echo "'$added_clang' is no executable." + exit 1 + fi + if ! test -x "$added_compilerwrapper" ; then + echo "'$added_compilerwrapper' is no executable." + exit 1 + fi fi +extrafiles= +while test "x$1" = "x--addfile"; do + shift + extrafiles="$extrafiles $1" + shift +done +tempdir=`mktemp -d /tmp/iceccenvXXXXXX` -add_file $added_gcc /usr/bin/gcc -add_file $added_gxx /usr/bin/g++ +# for testing the environment is usable at all +add_file /bin/true -if test -z "$added_as" ; then - add_file /usr/bin/as /usr/bin/as -else - if ! test -x "$added_as" ; then - echo "'$added_as' is no executable." - exit 1 - fi +if test -n "$gcc"; then + # getting compilers abs path + added_gcc=$(abs_path $added_gcc) + added_gxx=$(abs_path $added_gxx) - add_file $added_as /usr/bin/as -fi + if test -z "$clang"; then + add_file $added_gcc /usr/bin/gcc + add_file $added_gxx /usr/bin/g++ + else + # HACK: The clang case below will add a wrapper in place of gcc, so add the real + # gcc under a different name that the wrapper will call. + add_file $added_gcc /usr/bin/gcc.bin + add_file $added_gxx /usr/bin/g++.bin + fi + add_file `$added_gcc -print-prog-name=cc1` /usr/bin/cc1 + add_file `$added_gxx -print-prog-name=cc1plus` /usr/bin/cc1plus + + gcc_as=$($added_gcc -print-prog-name=as) + if test "$gcc_as" = "as"; then + add_file /usr/bin/as + else + add_file "$gcc_as" /usr/bin/as + fi -add_file `$added_gcc -print-prog-name=cc1` /usr/bin/cc1 -add_file `$added_gxx -print-prog-name=cc1plus` /usr/bin/cc1plus -specfile=`$added_gcc -print-file-name=specs` -if test -n "$specfile" && test -e "$specfile"; then - add_file "$specfile" + search_addfile $added_gcc specs + search_addfile $added_gcc liblto_plugin.so fi -ltofile=`$added_gcc -print-prog-name=lto1` -pluginfile="${ltofile%lto1}liblto_plugin.so" -if test -r "$pluginfile" -then - add_file $pluginfile ${pluginfile#*usr} - add_file $pluginfile /usr${pluginfile#*usr} +if test -n "$clang"; then + add_file $added_clang /usr/bin/clang + # HACK: Older icecream remotes have /usr/bin/{gcc|g++} hardcoded and wouldn't + # call /usr/bin/clang at all. So include a wrapper binary that will call gcc or clang + # depending on an extra argument added by icecream. + add_file $added_compilerwrapper /usr/bin/gcc + add_file $added_compilerwrapper /usr/bin/g++ + + add_file $($added_clang -print-prog-name=as) /usr/bin/as + + # clang always uses its internal .h files + clangincludes=$(dirname $($added_clang -print-file-name=include/limits.h)) + clangprefix=$(dirname $(dirname $added_clang)) + for file in $(find $clangincludes -type f); do + # get path without .. + destfile=$(readlink -e $file) + # and convert from <prefix> to /usr if needed + destfile=$(echo $destfile | sed "s#$clangprefix#/usr#" ) + add_file "$file" "$destfile" + done fi -tempdir=`mktemp -d /tmp/iceccenvXXXXXX` +for extrafile in $extrafiles; do + add_file $extrafile +done
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env if test "$1" = "--silent"; then · line 276
Quoted 10 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +8
-1+ +# IKLQ ? +# special case for weird multilib setups +for dir in /lib /lib64 /usr/lib /usr/lib64; do + test -L $dir && cp -p $dir $tempdir$dir +done + new_target_files= -for i in $target_files; do +for i in $target_files; do
Don't introduce trailing whitespaces
Quoted 7 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +0
-0case $i in *=/*) target=`echo $i | cut -d= -f1`@@ -151,11 +300,11 @@ target_files=`for i in $new_target_files; do echo $i; done | sort` #if not use the md5 of all files as the archive name if test -z "$archive_name"; then md5sum=NONE
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env target_files=`for i in $new_target_files; do echo $i; done | sort` · line 307
Quoted 10 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +5
-5- for file in /usr/bin/md5sum /bin/md5 /usr/bin/md5; do - if test -x $file; then - md5sum=$file - break - fi + for file in /usr/bin/md5sum /bin/md5 /usr/bin/md5 /sbin/md5; do + if test -x $file; then + md5sum=$file + break + fi
Don't introduce wrong indenntation.
Quoted 16 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +1
-0done #calculate md5 and use it as the archive name@@ -190,3 +339,4 @@ tar -czhf "$mydir/$archive_name" $target_files || { } cd .. rm -rf $tempdir +meta/recipes-devtools/icecc-create-env/icecc-create-env-native_1.0.1.bb renamed from meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb +0
-0
meta/recipes-devtools/icecc-create-env/icecc-create-env-native_1.0.1.bb SECTION = "base" · line 9
Quoted 5 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native_1.0.1.bb renamed from meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb +1
-1@@ -6,16 +6,13 @@ SECTION = "base" LICENSE = "GPLv2+" LIC_FILES_CHKSUM = "file://icecc-create-env;beginline=2;endline=5;md5=ae1df3d6a058bfda40b66094c5f6065f" -PR = "r2" +PR = "r0"
drop
meta/recipes-devtools/icecc-create-env/icecc-create-env-native_1.0.1.bb SECTION = "base" · line 15
Quoted 5 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native_1.0.1.bb renamed from meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb +0
-2DEPENDS = "" INHIBIT_DEFAULT_DEPS = "1" -FILESPATH = "${FILE_DIRNAME}/${PN}/" -
You cannot drop it without moving file to BPN (see
http://lists.openembedded.org/pipermail/openembedded-core/2013-December/087239.html
)
meta/recipes-devtools/icecc-create-env/icecc-create-env-native_1.0.1.bb SECTION = "base" · line 18
Quoted 3 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native_1.0.1.bb renamed from meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb +0
-1inherit native -PATCHTOOL = "patch"
You cannot drop it without causing dependency loop (see
http://lists.openembedded.org/pipermail/openembedded-core/2013-December/087239.html
)
Quoted 10 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native_1.0.1.bb renamed from meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb +0
-0SRC_URI = "file://icecc-create-env" S = "${WORKDIR}"Signature · 6 lines
1.7.10.4 _______________________________________________ Openembedded-core mailing list [email protected] http://lists.openembedded.org/mailman/listinfo/openembedded-core
Signature · 1 line
Martin 'JaMa' Jansa jabber: [email protected]
Quoted 14 lines · Martin Jansa
Quoted 5 lines · Iyad Qumei
The original icecc script does not handle toolchain content properly, resulting in build failures, such as
gxx: fatal error: -fuse-linker-plugin, but liblto_plugin.so not found
Quoted 7 lines
This patch brings in the latest script form the icecream source, and modifies it for use in the OE build environment. The change was tested with OE-Core built toolchain, and external toolchain.
Signed-off-by Iyad Qumei <[email protected]>--- .../icecc-create-env-native/icecc-create-env | 266+++++++++++++++-----
Quoted 8 lines
Quoted 3 lines
...ive_0.1.bb => icecc-create-env-native_1.0.1.bb} | 5 +- 2 files changed, 209 insertions(+), 62 deletions(-) rename meta/recipes-devtools/icecc-create-env/{icecc-create-env-native_0.1.bb => icecc-create-env-native_1.0.1.bb} (89%)
NACK
What are you trying to say?
This patch was created per instructions on how submit patches.
Quoted 9 lines
Quoted 2 lines
diff --git
a/meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env b/meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env
Quoted 2 lines
index 7e4dbc4..0eb2217 100755
---a/meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env
Quoted 1 line
+++
b/meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env
Quoted 9 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env add_file () · line 27
Quoted 6 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +1
-1@@ -24,12 +24,12 @@ add_file () fi test -z "$name" && return # ls -H isn't really the same as readlink, but - # readlink is not portable enough. + # readlink is not portable enough.Don't introduce trailing whitespaces
There is no space problems here, I checked it in vi, and indentation looks consistent in the context.
Quoted 298 lines
Quoted 11 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +1
-1path=`ls -H $path` toadd="$name=$path" is_contained "$toadd" && return if test -z "$silent"; then - echo "adding file $toadd" + echo "adding file $toadd" fi target_files="$target_files $toadd" if test -x "$path"; thenmeta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env add_file () · line 46
Quoted 4 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +0
-1@@ -43,19 +43,81 @@ add_file () # libc.so.6 => /lib/tls/libc.so.6 (0xb7e81000) # /lib/ld-linux.so.2 (0xb7fe8000) # covering both situations ( with => and without ) - for lib in `ldd "$path" | sed -n 's,^[^/]*\(/[^]*\).*,\1,p'`; do
Review add_file () · line 48
Quoted 2 lines
(quoted diff) +0
-2- test -f "$lib" || continue - # Check wether the same library also exists in the parentdirectory,
Review add_file () · line 49
Quoted 1 line
(quoted diff) +0
-1- # and prefer that on the assumption that it is a more genericone.
Review add_file () · line 50
Quoted 1 line
(quoted diff) +0
-1- local baselib=`echo "$lib" | sed's,\(/[^/]*\)/.*\(/[^/]*\)$,\1\2,'`
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env add_file ()
Quoted 5 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +1
-4- test -f "$baselib" && lib=$baselib - add_file "$lib" - done - fi + for lib in `ldd "$path" | sed -n 's,^[^/]*\(/[^]*\).*,\1,p'`; do
Review add_file () · line 48
Quoted 2 lines
(quoted diff) +2
-0+ test -f "$lib" || continue + # Check wether the same library also exists in the parentdirectory,
Review add_file () · line 49
Quoted 1 line
(quoted diff) +1
-0+ # and prefer that on the assumption that it is a more genericone.
Review add_file () · line 50
Quoted 1 line
(quoted diff) +1
-0+ local baselib=`echo "$lib" | sed's,\(/[^/]*\)/.*\(/[^/]*\)$,\1\2,'`
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env add_file () · line 54
Quoted 4 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +4
-0+ test -f "$baselib" && lib=$baselib + add_file "$lib" + done + fiDon't mix tabs and spaces.
fixed.
Quoted 22 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +18
-0fi fi } +# returns abs path to filedir +abs_path() +{ + local path=$1 + if test -f "$path"; then + pushd $(dirname $path) > /dev/null 2>&1 + dir_path=`pwd -P` + path=$dir_path/$(basename $path) + popd > /dev/null 2>&1 + elif test -d "$path"; then + pushd $path > /dev/null 2>&1 + path=`pwd -P` + popd > /dev/null 2>&1 + fi + echo $path +} + +# Search and add file to the tarball file.meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env add_file ()
Quoted 10 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +10
-0+search_addfile() +{ + local compiler=$1 + local file_name=$2 + local file_installdir=$3 + local file="" + + file=$($compiler -print-prog-name=$file_name) + + if test -z "$file" || test "$file" = "$file_name" || ! test -e"$file"; then
Quoted 11 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +11
-0+ file=`$compiler -print-file-name=$file_name` + fi + + if ! test -e "$file"; then + return 1 + fi + + if test -z "$file_installdir"; then + # The file is going to be added to the tarball + # in the same path where the compiler found it. +meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env add_file ()
Quoted 10 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +10
-0+ file_installdir=$(dirname $file) + abs_installdir=$(abs_path $file_installdir) + + if test "$file_installdir" != "$abs_installdir"; then + # The path where the compiler found the file is relative! + # If the path where the compiler found the file is relative + # to compiler's path, we must change it to be relative to + # /usr/bin path where the compiler is going to be installed + # in the tarball file. + # Replacing relative path by abs path because the tarcommand
Quoted 132 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +89
-27+ # used to create the tarball file doesn't work well with + # relative path as installdir. + + compiler_basedir=$(abs_path ${compiler%/*/*}) + file_installdir=${abs_installdir/$compiler_basedir/"/usr"} + fi + fi + + add_file "$file" "$file_installdir/$file_name" + + return 0 +} + # backward compat if test "$1" = "--respect-path"; then shift@@ -67,64 +129,151 @@ if test "$1" = "--silent"; then shift fi - -added_gcc=$1 -shift -added_gxx=$1 -shift -added_as=$1 -shift -archive_name=$1 - -if test -z "$added_gcc" || test -z "$added_gxx" ; then - echo "usage: $0 <gcc_path> <g++_path>" - exit 1 +if test "$1" != "--gcc" -a "$1" != "--clang"; then + # backward compat + added_gcc=$1 + shift + added_gxx=$1 + shift + added_as=$1 + shift + archive_name=$1 + shift + gcc=1 +else + if test "$1" = "--gcc"; then + shift + added_gcc=$1 + shift + added_gxx=$1 + shift + added_as=$1 + shift + archive_name=$1 + shift + gcc=1 + elif test "$1" = "--clang"; then + shift + added_clang=$1 + shift + added_compilerwrapper=$1 + shift + clang=1 + else + usage + exit 1 + fi fi -if ! test -x "$added_gcc" ; then - echo "'$added_gcc' is no executable." - exit 1 +if test -n "$gcc"; then + if test -z "$added_gcc" || test -z "$added_gxx"; then + usage + exit 1 + fi + if ! test -x "$added_gcc" ; then + echo "'$added_gcc' is no executable." + exit 1 + fi + if ! test -x "$added_gxx" ; then + echo "'$added_gxx' is no executable." + exit 1 + fi + if test -z "$added_as" ; then + add_file /usr/bin/as /usr/bin/as + else + if ! test -x "$added_as" ; then + echo "'$added_as' is no executable." + exit 1 + fi + add_file $added_as /usr/bin/as + fi fi -if ! test -x "$added_gxx" ; then - echo "'$added_gcc' is no executable." - exit 1 +if test -n "$clang"; then + if ! test -x "$added_clang" ; then + echo "'$added_clang' is no executable." + exit 1 + fi + if ! test -x "$added_compilerwrapper" ; then + echo "'$added_compilerwrapper' is no executable." + exit 1 + fi fi +extrafiles= +while test "x$1" = "x--addfile"; do + shift + extrafiles="$extrafiles $1" + shift +done +tempdir=`mktemp -d /tmp/iceccenvXXXXXX` -add_file $added_gcc /usr/bin/gcc -add_file $added_gxx /usr/bin/g++ +# for testing the environment is usable at all +add_file /bin/true -if test -z "$added_as" ; then - add_file /usr/bin/as /usr/bin/as -else - if ! test -x "$added_as" ; then - echo "'$added_as' is no executable." - exit 1 - fi +if test -n "$gcc"; then + # getting compilers abs pathmeta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env if test "$1" = "--silent"; then · line 224
Quoted 10 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +7
-2+ added_gcc=$(abs_path $added_gcc) + added_gxx=$(abs_path $added_gxx) - add_file $added_as /usr/bin/as -fi + if test -z "$clang"; then + add_file $added_gcc /usr/bin/gcc + add_file $added_gxx /usr/bin/g++ + else + # HACK: The clang case below will add a wrapper in place ofgcc, so add the real
Quoted 22 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +15
-5+ # gcc under a different name that the wrapper will call. + add_file $added_gcc /usr/bin/gcc.bin + add_file $added_gxx /usr/bin/g++.bin + fi + add_file `$added_gcc -print-prog-name=cc1` /usr/bin/cc1 + add_file `$added_gxx -print-prog-name=cc1plus` /usr/bin/cc1plus + + gcc_as=$($added_gcc -print-prog-name=as) + if test "$gcc_as" = "as"; then + add_file /usr/bin/as + else + add_file "$gcc_as" /usr/bin/as + fi -add_file `$added_gcc -print-prog-name=cc1` /usr/bin/cc1 -add_file `$added_gxx -print-prog-name=cc1plus` /usr/bin/cc1plus -specfile=`$added_gcc -print-file-name=specs` -if test -n "$specfile" && test -e "$specfile"; then - add_file "$specfile" + search_addfile $added_gcc specs + search_addfile $added_gcc liblto_plugin.so fimeta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env if test "$1" = "--silent"; then
Quoted 10 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +3
-6-ltofile=`$added_gcc -print-prog-name=lto1` -pluginfile="${ltofile%lto1}liblto_plugin.so" -if test -r "$pluginfile" -then - add_file $pluginfile ${pluginfile#*usr} - add_file $pluginfile /usr${pluginfile#*usr} +if test -n "$clang"; then + add_file $added_clang /usr/bin/clang + # HACK: Older icecream remotes have /usr/bin/{gcc|g++} hardcodedand wouldn't
Review if test "$1" = "--silent"; then · line 246
Quoted 1 line
(quoted diff) +1
-0+ # call /usr/bin/clang at all. So include a wrapper binary that willcall gcc or clang
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env if test "$1" = "--silent"; then
Quoted 8 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +8
-0+ # depending on an extra argument added by icecream. + add_file $added_compilerwrapper /usr/bin/gcc + add_file $added_compilerwrapper /usr/bin/g++ + + add_file $($added_clang -print-prog-name=as) /usr/bin/as + + # clang always uses its internal .h files + clangincludes=$(dirname $($added_clang-print-file-name=include/limits.h))
Quoted 10 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +8
-0+ clangprefix=$(dirname $(dirname $added_clang)) + for file in $(find $clangincludes -type f); do + # get path without .. + destfile=$(readlink -e $file) + # and convert from <prefix> to /usr if needed + destfile=$(echo $destfile | sed "s#$clangprefix#/usr#" ) + add_file "$file" "$destfile" + done fi
Quoted 17 lines
Quoted 4 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +3
-1-tempdir=`mktemp -d /tmp/iceccenvXXXXXX` +for extrafile in $extrafiles; do + add_file $extrafile +donemeta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env if test "$1" = "--silent"; then · line 276
Quoted 10 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +8
-1+ +# IKLQ ? +# special case for weird multilib setups +for dir in /lib /lib64 /usr/lib /usr/lib64; do + test -L $dir && cp -p $dir $tempdir$dir +done + new_target_files= -for i in $target_files; do +for i in $target_files; doDon't introduce trailing whitespaces
fixed
Quoted 19 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env target_files=`for i in $new_target_files; do echo
Quoted 4 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +0
-0case $i in *=/*) target=`echo $i | cut -d= -f1`@@ -151,11 +300,11 @@ target_files=`for i in $new_target_files; do echo$i; done | sort`
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env target_files=`for i in $new_target_files; do echo $i; done | sort` · line 307
Quoted 13 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +5
-5#if not use the md5 of all files as the archive name if test -z "$archive_name"; then md5sum=NONE - for file in /usr/bin/md5sum /bin/md5 /usr/bin/md5; do - if test -x $file; then - md5sum=$file - break - fi + for file in /usr/bin/md5sum /bin/md5 /usr/bin/md5 /sbin/md5; do + if test -x $file; then + md5sum=$file + break + fi
Quoted 2 lines
Don't introduce wrong indenntation.
Checked indentation in vi, looks consistent with context.
Quoted 27 lines
Review
Quoted 10 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +1
-0done #calculate md5 and use it as the archive name@@ -190,3 +339,4 @@ tar -czhf "$mydir/$archive_name" $target_files || { } cd .. rm -rf $tempdir +(quoted diff) +0
-0icecc-create-env-native_0.1.bb b/meta/recipes-devtools/icecc-create-env/ icecc-create-env-native_1.0.1.bb
Quoted 2 lines
similarity index 89%
rename from meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb
Quoted 1 line
rename to meta/recipes-devtools/icecc-create-env/
icecc-create-env-native_1.0.1.bb
Quoted 2 lines
index b04474e..c03cf5a 100644
--- a/meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb
Quoted 1 line
+++ b/meta/recipes-devtools/icecc-create-env/
icecc-create-env-native_1.0.1.bb
Review SECTION = "base" · line 7
Quoted 3 lines
(quoted diff) +0
-0@@ -6,16 +6,13 @@ SECTION = "base" LICENSE = "GPLv2+" LIC_FILES_CHKSUM ="file://icecc-create-env;beginline=2;endline=5;md5=ae1df3d6a058bfda40b66094c5f6065f"
Quoted 1 line
Quoted 5 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native_1.0.1.bb SECTION = "base" · line 9
Quoted 2 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native_1.0.1.bb renamed from meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb +1
-1-PR = "r2" +PR = "r0"drop
why, this new recipe for version 1.0.1.
Quoted 11 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native_1.0.1.bb SECTION = "base" · line 15
Quoted 6 lines
DEPENDS = ""
INHIBIT_DEFAULT_DEPS= "1"meta/recipes-devtools/icecc-create-env/icecc-create-env-native_1.0.1.bb renamed from meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb +0
-2-FILESPATH = "${FILE_DIRNAME}/${PN}/" -You cannot drop it without moving file to BPN (see
http://lists.openembedded.org/pipermail/openembedded-core/2013-December/087239.html
You are actually referring us to a patch you just submitted after my message. This comment must be a joke!
Quoted 9 lines
)
Quoted 3 lines
inherit native
-PATCHTOOL = "patch"
You cannot drop it without causing dependency loop (see
http://lists.openembedded.org/pipermail/openembedded-core/2013-December/087239.html
ditto.
Quoted 16 lines
)
Quoted 10 lines
SRC_URI= "file://icecc-create-env"S = "${WORKDIR}"
--
1.7.10.4_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core--
Martin 'JaMa' Jansa jabber: [email protected]
After more thinking about this, and rebuilding. I do see both issues. Although I did successful build last night, which I still do, quilt-native guilt find, and icecc-create-env in sysroot is the correct version. The difference is how I issued the build core-minimal-image vs quilt-native and icecc-create-env-native.
I will reinstate both definitions to the recipe. Sorry for the misunderstanding.
Quoted 11 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native_1.0.1.bb SECTION = "base" · line 15
Quoted 6 lines
DEPENDS = ""
INHIBIT_DEFAULT_DEPS= "1"meta/recipes-devtools/icecc-create-env/icecc-create-env-native_1.0.1.bb renamed from meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb +0
-2-FILESPATH = "${FILE_DIRNAME}/${PN}/" -You cannot drop it without moving file to BPN (see
http://lists.openembedded.org/pipermail/openembedded-core/2013-December/087239.html
)
Quoted 9 lines
Quoted 3 lines
inherit native
-PATCHTOOL = "patch"
You cannot drop it without causing dependency loop (see
http://lists.openembedded.org/pipermail/openembedded-core/2013-December/087239.html
)
Quoted 7 lines
--
Martin 'JaMa' Jansa jabber: [email protected]
l
Quoted 16 lines · Iyad Qumei
Quoted 14 lines · Martin Jansa
Quoted 5 lines · Iyad Qumei
The original icecc script does not handle toolchain content properly, resulting in build failures, such as
gxx: fatal error: -fuse-linker-plugin, but liblto_plugin.so not found
Quoted 7 lines
This patch brings in the latest script form the icecream source, and modifies it for use in the OE build environment. The change was tested with OE-Core built toolchain, and external toolchain.
Signed-off-by Iyad Qumei <[email protected]>--- .../icecc-create-env-native/icecc-create-env | 266+++++++++++++++-----
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
...ive_0.1.bb => icecc-create-env-native_1.0.1.bb} | 5 +- 2 files changed, 209 insertions(+), 62 deletions(-) rename meta/recipes-devtools/icecc-create-env/{icecc-create-env-native_0.1.bb => icecc-create-env-native_1.0.1.bb} (89%)
NACK
What are you trying to say?
http://en.wikipedia.org/wiki/NAK_(protocol_message)
Quoted 1 line
This patch was created per instructions on how submit patches.
That doesn't make it correct functionality-wise.
Quoted 19 lines
Quoted 9 lines
Quoted 2 lines
diff --git
a/meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env b/meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env
Quoted 2 lines
index 7e4dbc4..0eb2217 100755
---a/meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env
Quoted 1 line
+++
b/meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env
Quoted 9 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env add_file () · line 27
Quoted 6 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +1
-1@@ -24,12 +24,12 @@ add_file () fi test -z "$name" && return # ls -H isn't really the same as readlink, but - # readlink is not portable enough. + # readlink is not portable enough.Don't introduce trailing whitespaces
Quoted 2 lines
There is no space problems here, I checked it in vi, and indentation looks consistent in the context.
Then there is something wrong with your vi.
You can even see it by highlighting the line with mouse in patchwork
http://patchwork.openembedded.org/patch/62843/
Quoted 339 lines
Quoted 299 lines
Quoted 12 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +1
-1path=`ls -H $path` toadd="$name=$path" is_contained "$toadd" && return if test -z "$silent"; then - echo "adding file $toadd" + echo "adding file $toadd" fi target_files="$target_files $toadd" if test -x "$path"; thenmeta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env add_file () · line 46
Quoted 4 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +0
-1@@ -43,19 +43,81 @@ add_file () # libc.so.6 => /lib/tls/libc.so.6 (0xb7e81000) # /lib/ld-linux.so.2 (0xb7fe8000) # covering both situations ( with => and without ) - for lib in `ldd "$path" | sed -n 's,^[^/]*\(/[^]*\).*,\1,p'`; do
Review add_file () · line 48
Quoted 2 lines
(quoted diff) +0
-2- test -f "$lib" || continue - # Check wether the same library also exists in the parentdirectory,
Review add_file () · line 49
Quoted 1 line
(quoted diff) +0
-1- # and prefer that on the assumption that it is a more genericone.
Review add_file () · line 50
Quoted 1 line
(quoted diff) +0
-1- local baselib=`echo "$lib" | sed's,\(/[^/]*\)/.*\(/[^/]*\)$,\1\2,'`
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env add_file ()
Quoted 5 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +1
-4- test -f "$baselib" && lib=$baselib - add_file "$lib" - done - fi + for lib in `ldd "$path" | sed -n 's,^[^/]*\(/[^]*\).*,\1,p'`; do
Review add_file () · line 48
Quoted 2 lines
(quoted diff) +2
-0+ test -f "$lib" || continue + # Check wether the same library also exists in the parentdirectory,
Review add_file () · line 49
Quoted 1 line
(quoted diff) +1
-0+ # and prefer that on the assumption that it is a more genericone.
Review add_file () · line 50
Quoted 1 line
(quoted diff) +1
-0+ local baselib=`echo "$lib" | sed's,\(/[^/]*\)/.*\(/[^/]*\)$,\1\2,'`
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env add_file () · line 54
Quoted 4 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +4
-0+ test -f "$baselib" && lib=$baselib + add_file "$lib" + done + fiDon't mix tabs and spaces.
fixed.
Quoted 22 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +18
-0fi fi } +# returns abs path to filedir +abs_path() +{ + local path=$1 + if test -f "$path"; then + pushd $(dirname $path) > /dev/null 2>&1 + dir_path=`pwd -P` + path=$dir_path/$(basename $path) + popd > /dev/null 2>&1 + elif test -d "$path"; then + pushd $path > /dev/null 2>&1 + path=`pwd -P` + popd > /dev/null 2>&1 + fi + echo $path +} + +# Search and add file to the tarball file.meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env add_file ()
Quoted 10 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +10
-0+search_addfile() +{ + local compiler=$1 + local file_name=$2 + local file_installdir=$3 + local file="" + + file=$($compiler -print-prog-name=$file_name) + + if test -z "$file" || test "$file" = "$file_name" || ! test -e"$file"; then
Quoted 11 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +11
-0+ file=`$compiler -print-file-name=$file_name` + fi + + if ! test -e "$file"; then + return 1 + fi + + if test -z "$file_installdir"; then + # The file is going to be added to the tarball + # in the same path where the compiler found it. +meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env add_file ()
Quoted 10 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +10
-0+ file_installdir=$(dirname $file) + abs_installdir=$(abs_path $file_installdir) + + if test "$file_installdir" != "$abs_installdir"; then + # The path where the compiler found the file is relative! + # If the path where the compiler found the file is relative + # to compiler's path, we must change it to be relative to + # /usr/bin path where the compiler is going to be installed + # in the tarball file. + # Replacing relative path by abs path because the tarcommand
Quoted 132 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +89
-27+ # used to create the tarball file doesn't work well with + # relative path as installdir. + + compiler_basedir=$(abs_path ${compiler%/*/*}) + file_installdir=${abs_installdir/$compiler_basedir/"/usr"} + fi + fi + + add_file "$file" "$file_installdir/$file_name" + + return 0 +} + # backward compat if test "$1" = "--respect-path"; then shift@@ -67,64 +129,151 @@ if test "$1" = "--silent"; then shift fi - -added_gcc=$1 -shift -added_gxx=$1 -shift -added_as=$1 -shift -archive_name=$1 - -if test -z "$added_gcc" || test -z "$added_gxx" ; then - echo "usage: $0 <gcc_path> <g++_path>" - exit 1 +if test "$1" != "--gcc" -a "$1" != "--clang"; then + # backward compat + added_gcc=$1 + shift + added_gxx=$1 + shift + added_as=$1 + shift + archive_name=$1 + shift + gcc=1 +else + if test "$1" = "--gcc"; then + shift + added_gcc=$1 + shift + added_gxx=$1 + shift + added_as=$1 + shift + archive_name=$1 + shift + gcc=1 + elif test "$1" = "--clang"; then + shift + added_clang=$1 + shift + added_compilerwrapper=$1 + shift + clang=1 + else + usage + exit 1 + fi fi -if ! test -x "$added_gcc" ; then - echo "'$added_gcc' is no executable." - exit 1 +if test -n "$gcc"; then + if test -z "$added_gcc" || test -z "$added_gxx"; then + usage + exit 1 + fi + if ! test -x "$added_gcc" ; then + echo "'$added_gcc' is no executable." + exit 1 + fi + if ! test -x "$added_gxx" ; then + echo "'$added_gxx' is no executable." + exit 1 + fi + if test -z "$added_as" ; then + add_file /usr/bin/as /usr/bin/as + else + if ! test -x "$added_as" ; then + echo "'$added_as' is no executable." + exit 1 + fi + add_file $added_as /usr/bin/as + fi fi -if ! test -x "$added_gxx" ; then - echo "'$added_gcc' is no executable." - exit 1 +if test -n "$clang"; then + if ! test -x "$added_clang" ; then + echo "'$added_clang' is no executable." + exit 1 + fi + if ! test -x "$added_compilerwrapper" ; then + echo "'$added_compilerwrapper' is no executable." + exit 1 + fi fi +extrafiles= +while test "x$1" = "x--addfile"; do + shift + extrafiles="$extrafiles $1" + shift +done +tempdir=`mktemp -d /tmp/iceccenvXXXXXX` -add_file $added_gcc /usr/bin/gcc -add_file $added_gxx /usr/bin/g++ +# for testing the environment is usable at all +add_file /bin/true -if test -z "$added_as" ; then - add_file /usr/bin/as /usr/bin/as -else - if ! test -x "$added_as" ; then - echo "'$added_as' is no executable." - exit 1 - fi +if test -n "$gcc"; then + # getting compilers abs pathmeta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env if test "$1" = "--silent"; then · line 224
Quoted 10 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +7
-2+ added_gcc=$(abs_path $added_gcc) + added_gxx=$(abs_path $added_gxx) - add_file $added_as /usr/bin/as -fi + if test -z "$clang"; then + add_file $added_gcc /usr/bin/gcc + add_file $added_gxx /usr/bin/g++ + else + # HACK: The clang case below will add a wrapper in place ofgcc, so add the real
Quoted 22 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +15
-5+ # gcc under a different name that the wrapper will call. + add_file $added_gcc /usr/bin/gcc.bin + add_file $added_gxx /usr/bin/g++.bin + fi + add_file `$added_gcc -print-prog-name=cc1` /usr/bin/cc1 + add_file `$added_gxx -print-prog-name=cc1plus` /usr/bin/cc1plus + + gcc_as=$($added_gcc -print-prog-name=as) + if test "$gcc_as" = "as"; then + add_file /usr/bin/as + else + add_file "$gcc_as" /usr/bin/as + fi -add_file `$added_gcc -print-prog-name=cc1` /usr/bin/cc1 -add_file `$added_gxx -print-prog-name=cc1plus` /usr/bin/cc1plus -specfile=`$added_gcc -print-file-name=specs` -if test -n "$specfile" && test -e "$specfile"; then - add_file "$specfile" + search_addfile $added_gcc specs + search_addfile $added_gcc liblto_plugin.so fimeta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env if test "$1" = "--silent"; then
Quoted 10 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +3
-6-ltofile=`$added_gcc -print-prog-name=lto1` -pluginfile="${ltofile%lto1}liblto_plugin.so" -if test -r "$pluginfile" -then - add_file $pluginfile ${pluginfile#*usr} - add_file $pluginfile /usr${pluginfile#*usr} +if test -n "$clang"; then + add_file $added_clang /usr/bin/clang + # HACK: Older icecream remotes have /usr/bin/{gcc|g++} hardcodedand wouldn't
Review if test "$1" = "--silent"; then · line 246
Quoted 1 line
(quoted diff) +1
-0+ # call /usr/bin/clang at all. So include a wrapper binary that willcall gcc or clang
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env if test "$1" = "--silent"; then
Quoted 8 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +8
-0+ # depending on an extra argument added by icecream. + add_file $added_compilerwrapper /usr/bin/gcc + add_file $added_compilerwrapper /usr/bin/g++ + + add_file $($added_clang -print-prog-name=as) /usr/bin/as + + # clang always uses its internal .h files + clangincludes=$(dirname $($added_clang-print-file-name=include/limits.h))
Quoted 10 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +8
-0+ clangprefix=$(dirname $(dirname $added_clang)) + for file in $(find $clangincludes -type f); do + # get path without .. + destfile=$(readlink -e $file) + # and convert from <prefix> to /usr if needed + destfile=$(echo $destfile | sed "s#$clangprefix#/usr#" ) + add_file "$file" "$destfile" + done fiQuoted 17 lines
Quoted 4 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +3
-1-tempdir=`mktemp -d /tmp/iceccenvXXXXXX` +for extrafile in $extrafiles; do + add_file $extrafile +donemeta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env if test "$1" = "--silent"; then · line 276
Quoted 10 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +8
-1+ +# IKLQ ? +# special case for weird multilib setups +for dir in /lib /lib64 /usr/lib /usr/lib64; do + test -L $dir && cp -p $dir $tempdir$dir +done + new_target_files= -for i in $target_files; do +for i in $target_files; doDon't introduce trailing whitespaces
fixed
Quoted 19 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env target_files=`for i in $new_target_files; do echo
Quoted 4 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +0
-0case $i in *=/*) target=`echo $i | cut -d= -f1`@@ -151,11 +300,11 @@ target_files=`for i in $new_target_files; do echo$i; done | sort`
Quoted 13 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +5
-5#if not use the md5 of all files as the archive name if test -z "$archive_name"; then md5sum=NONE - for file in /usr/bin/md5sum /bin/md5 /usr/bin/md5; do - if test -x $file; then - md5sum=$file - break - fi + for file in /usr/bin/md5sum /bin/md5 /usr/bin/md5 /sbin/md5; do + if test -x $file; then + md5sum=$file + break + fi
Quoted 4 lines
Quoted 2 lines
Don't introduce wrong indenntation.
Checked indentation in vi, looks consistent with context.
It was using 2 spaces in most cases (tabs and 1 space in few cases).
Adding one space inside that for loop changes it to 5 which cannot be improvement, fixing all indentation in separate patch would be nice.
Adding /sbin/md5 isn't mentioned in commit message.
Quoted 28 lines
Quoted 28 lines
Review
Quoted 11 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env +1
-0done #calculate md5 and use it as the archive name@@ -190,3 +339,4 @@ tar -czhf "$mydir/$archive_name" $target_files || { } cd .. rm -rf $tempdir +(quoted diff) +0
-0icecc-create-env-native_0.1.bb b/meta/recipes-devtools/icecc-create-env/ icecc-create-env-native_1.0.1.bb
Quoted 2 lines
similarity index 89%
rename from meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb
Quoted 1 line
rename to meta/recipes-devtools/icecc-create-env/
icecc-create-env-native_1.0.1.bb
Quoted 2 lines
index b04474e..c03cf5a 100644
--- a/meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb
Quoted 1 line
+++ b/meta/recipes-devtools/icecc-create-env/
icecc-create-env-native_1.0.1.bb
Review SECTION = "base" · line 7
Quoted 3 lines
(quoted diff) +0
-0@@ -6,16 +6,13 @@ SECTION = "base" LICENSE = "GPLv2+" LIC_FILES_CHKSUM ="file://icecc-create-env;beginline=2;endline=5;md5=ae1df3d6a058bfda40b66094c5f6065f"
Quoted 1 line
Quoted 7 lines
Quoted 5 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native_1.0.1.bb SECTION = "base" · line 9
Quoted 2 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native_1.0.1.bb renamed from meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb +1
-1-PR = "r2" +PR = "r0"drop
why, this new recipe for version 1.0.1.
drop PR variable completely, we're dropping them with every PV upgrade for couple months now.
Quoted 10 lines
Quoted 10 lines
meta/recipes-devtools/icecc-create-env/icecc-create-env-native_1.0.1.bb SECTION = "base" · line 15
Quoted 7 lines
DEPENDS = ""
INHIBIT_DEFAULT_DEPS= "1"meta/recipes-devtools/icecc-create-env/icecc-create-env-native_1.0.1.bb renamed from meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb +0
-2-FILESPATH = "${FILE_DIRNAME}/${PN}/" -You cannot drop it without moving file to BPN (see
Quoted 5 lines
You are actually referring us to a patch you just submitted after my message. This comment must be a joke!
If you check
http://git.shr-project.org/git/?p=oe-core.git;a=shortlog;h=refs/heads/jansa/test
http://git.shr-project.org/git/?p=oe-core.git;a=commit;h=fd2a9c5538ad5336c3822128a8880cff357754c9
you can see that I did that change 2 days ago, just haven't sent the patch yet, but that's not the point, point is that I've noticed that you made the same mistake as I did before, so I've sent my patch as reference and explanation for you (and everybody else who will also try to remove seemingly unnecessary PATCHTOOL/FILESPATH).
Sending changes not tested in master must be a joke! I believe you've tested it in Dylan, but that's not enough.
Quoted 11 lines
Quoted 9 lines
)
Quoted 3 lines
inherit native
-PATCHTOOL = "patch"
You cannot drop it without causing dependency loop (see
http://lists.openembedded.org/pipermail/openembedded-core/2013-December/087239.html
ditto.
ditto
Quoted 18 lines
Quoted 18 lines
)
Quoted 10 lines
SRC_URI= "file://icecc-create-env"S = "${WORKDIR}"
--
1.7.10.4_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core--
Martin 'JaMa' Jansa jabber: [email protected]
Signature · 1 line
Martin 'JaMa' Jansa jabber: [email protected]