gcc: use relative path for configure script

The absolute path (/path/to/configure) caused __FILE__ to be
an absolute path.

If 'assert' invoked, it uses __FILE__, and build path would be in elf files.
In assert.h
...
.# define assert(expr)                                                   \
  ((expr)                                                               \
   ? __ASSERT_VOID_CAST (0)                                             \
   : __assert_fail (__STRING(expr), __FILE__, __LINE__, __ASSERT_FUNCTION))
...

Which triggered buildpaths QA issue:
...
| libgcc-5.3.0: File work/core2-64-poky-linux/libgcc/5.3.0-r0/packages-split/
libgcc-dev/usr/lib64/x86_64-poky-linux/5.3.0/libgcc.a in package contained
reference to tmpdir [buildpaths]
...

Use relative path to run configure can fix the problem.

[YOCTO #7058]

(From OE-Core rev: b806e4c004a7e10461fe7428fc130a5aa2528039)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Hongxu Jia
2016-02-19 00:54:40 -05:00
committed by Richard Purdie
parent 1f00fb2eb6
commit b14e2ae9bc
4 changed files with 8 additions and 4 deletions

View File

@@ -29,7 +29,8 @@ do_configure () {
mkdir -p ${B}/$target/$d/
cd ${B}/$target/$d/
chmod a+x ${S}/$d/configure
${S}/$d/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
relpath=${@os.path.relpath("${S}/$d", "${B}/$target/$d")}
$relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
done
}

View File

@@ -23,7 +23,8 @@ do_configure () {
mkdir -p ${B}/$target/libsanitizer/
cd ${B}/$target/libsanitizer/
chmod a+x ${S}/libsanitizer/configure
${S}/libsanitizer/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
relpath=${@os.path.relpath("${S}/libsanitizer", "${B}/$target/libsanitizer")}
$relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
# Easiest way to stop bad RPATHs getting into the library since we have a
# broken libtool here
sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${B}/$target/libsanitizer/libtool

View File

@@ -12,7 +12,8 @@ do_configure () {
mkdir -p ${B}/$target/${BPN}/
cd ${B}/${BPN}
chmod a+x ${S}/${BPN}/configure
${S}/${BPN}/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
relpath=${@os.path.relpath("${S}/${BPN}", "${B}/${BPN}")}
$relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
}
do_compile () {

View File

@@ -15,7 +15,8 @@ do_configure () {
mkdir -p ${B}/$target/libgfortran/
cd ${B}/$target/libgfortran/
chmod a+x ${S}/libgfortran/configure
${S}/libgfortran/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
relpath=${@os.path.relpath("${S}/libgfortran", "${B}/$target/libgfortran")}
$relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
# Easiest way to stop bad RPATHs getting into the library since we have a
# broken libtool here
sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${B}/$target/libgfortran/libtool