Skip to contentSkip to conversation

gcc: use ${base_lib} to match gcc default configuration

PATCH In review Kumar Gala 5 participants 10 messages Aug 4, 2011 – Aug 11, 2011

lore
Share & tools
lore

Kumar Gala

author
#0 lore raw

PATCH 1/1 gcc: use ${base_lib} to match gcc default configuration

Rather than tweaking MULTILIB_DIRNAMES & MULTILIB_OSDIRNAMES like is done for x86-64 via 64bithack.patch. We can just go with gcc defaults and utilize ${base_lib} for where to find gcc libs.

---
 .../gcc/gcc-cross-intermediate.inc                 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
meta/recipes-devtools/gcc/gcc-cross-intermediate.inc +1 -1
index df5958a..7b1bb38 100644
@@ -34,7 +34,7 @@ do_compile () {
 do_install () {
 	oe_runmake 'DESTDIR=${D}' install
 	install -d ${D}${target_base_libdir}/
-	mv ${D}${exec_prefix}/${TARGET_SYS}/lib/* ${D}${target_base_libdir}/
+	mv ${D}${exec_prefix}/${TARGET_SYS}/${baselib}/* ${D}${target_base_libdir}/
 
 	# We don't really need this (here shares/ contains man/, info/, locale/).
 	rm -rf ${D}${datadir}/
Signature · 1 line
1.7.3.4
author
#1 lore raw
Quoted 24 lines · Kumar Gala

Rather than tweaking MULTILIB_DIRNAMES & MULTILIB_OSDIRNAMES like is done for x86-64 via 64bithack.patch. We can just go with gcc defaults and utilize ${base_lib} for where to find gcc libs.

---
.../gcc/gcc-cross-intermediate.inc | 2 +-

1 files changed, 1 insertions(+), 1 deletions(-)
meta/recipes-devtools/gcc/gcc-cross-intermediate.inc +1 -1
index df5958a..7b1bb38 100644
@@ -34,7 +34,7 @@ do_compile () {
 do_install () {
 	oe_runmake 'DESTDIR=${D}' install
 	install -d ${D}${target_base_libdir}/
-	mv ${D}${exec_prefix}/${TARGET_SYS}/lib/* ${D}${target_base_libdir}/
+	mv ${D}${exec_prefix}/${TARGET_SYS}/${baselib}/* ${D}${target_base_libdir}/
 
 	# We don't really need this (here shares/ contains man/, info/, locale/).
 	rm -rf ${D}${datadir}/
Signature · 1 line
1.7.3.4

ping

- k

#2 lore raw
Quoted 23 lines · Kumar Gala
Quoted 20 lines · Kumar Gala

Rather than tweaking MULTILIB_DIRNAMES& MULTILIB_OSDIRNAMES like is done for x86-64 via 64bithack.patch. We can just go with gcc defaults and utilize ${base_lib} for where to find gcc libs.

---
.../gcc/gcc-cross-intermediate.inc | 2 +-

1 files changed, 1 insertions(+), 1 deletions(-)
meta/recipes-devtools/gcc/gcc-cross-intermediate.inc +1 -1
index df5958a..7b1bb38 100644
@@ -34,7 +34,7 @@ do_compile () {
 do_install () {
 	oe_runmake 'DESTDIR=${D}' install
 	install -d ${D}${target_base_libdir}/
-	mv ${D}${exec_prefix}/${TARGET_SYS}/lib/* ${D}${target_base_libdir}/
+	mv ${D}${exec_prefix}/${TARGET_SYS}/${baselib}/* ${D}${target_base_libdir}/
 
Quoted 6 lines
Quoted 4 lines
meta/recipes-devtools/gcc/gcc-cross-intermediate.inc +0 -1
 	# We don't really need this (here shares/ contains man/, info/, locale/).
 	rm -rf ${D}${datadir}/
--

1.7.3.4

ping

Kumar,

I need to check with Richard on the bitbake.conf and this change, it's in my pending queue for a pull later today.

Sau!

Quoted 7 lines

- k
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

#3 lore raw
In reply to Kumar Gala

Hi Kumar,

I just found this patch breaks the qemux86-64 lib64 multilib build.

the error log is as below:

| mv: cannot stat `/home/kyu3/sdb/multilib2/tmp/work/x86_64-pokymllib64-linux/lib64-gcc-cross-intermediate-4.6.1+svnr175454-r4/image/home/kyu3/sdb/multilib2/tmp/sysroots/x86_64-linux/usr/x86_64-pokymllib64-linux/lib64/*': No such file or directory
NOTE: package lib64-gcc-cross-intermediate-4.6.1+svnr175454-r4: task do_install: Failed
ERROR: Task 1557 (virtual:multilib:lib64:/home/kyu3/src/poky/meta/recipes-devtools/gcc/gcc-cross-intermediate_4.6.bb, do_install) failed with exit code

the error is caused by command in gcc-cross-intermediate.inc: do_install(): "mv ${D}${exec_prefix}/${TARGET_SYS}/${baselib}/* ${D}${target_base_libdir}/"

and the reason is that: ${baselib} is lib64 in multilib case, while the files to be moved is still in ${D}${exec_prefix}/${TARGET_SYS}/lib/*, so mv will fail.

The fix may be either reverting this commit, or putting the file to ${baselib} instead of lib. I'd like to get your input before going further.

Regards
Ke

Quoted 22 lines · Kumar Gala

Rather than tweaking MULTILIB_DIRNAMES& MULTILIB_OSDIRNAMES like is done for x86-64 via 64bithack.patch. We can just go with gcc defaults and utilize ${base_lib} for where to find gcc libs.

---
  .../gcc/gcc-cross-intermediate.inc                 |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
meta/recipes-devtools/gcc/gcc-cross-intermediate.inc +1 -1
index df5958a..7b1bb38 100644
@@ -34,7 +34,7 @@ do_compile () {
  do_install () {
  	oe_runmake 'DESTDIR=${D}' install
  	install -d ${D}${target_base_libdir}/
-	mv ${D}${exec_prefix}/${TARGET_SYS}/lib/* ${D}${target_base_libdir}/
+	mv ${D}${exec_prefix}/${TARGET_SYS}/${baselib}/* ${D}${target_base_libdir}/
 
  	# We don't really need this (here shares/ contains man/, info/, locale/).
  	rm -rf ${D}${datadir}/
author
#4 lore raw

revert this is not acceptable as that will break ppc64 builds.

I think you need to look at 64bithack.patch and if we really should be using it for multilib builds.

- k

Quoted 42 lines · Yu Ke

Hi Kumar,

I just found this patch breaks the qemux86-64 lib64 multilib build.

the error log is as below:

| mv: cannot stat `/home/kyu3/sdb/multilib2/tmp/work/x86_64-pokymllib64-linux/lib64-gcc-cross-intermediate-4.6.1+svnr175454-r4/image/home/kyu3/sdb/multilib2/tmp/sysroots/x86_64-linux/usr/x86_64-pokymllib64-linux/lib64/*': No such file or directory
NOTE: package lib64-gcc-cross-intermediate-4.6.1+svnr175454-r4: task do_install: Failed
ERROR: Task 1557 (virtual:multilib:lib64:/home/kyu3/src/poky/meta/recipes-devtools/gcc/gcc-cross-intermediate_4.6.bb, do_install) failed with exit code

the error is caused by command in gcc-cross-intermediate.inc: do_install(): "mv ${D}${exec_prefix}/${TARGET_SYS}/${baselib}/* ${D}${target_base_libdir}/"

and the reason is that: ${baselib} is lib64 in multilib case, while the files to be moved is still in ${D}${exec_prefix}/${TARGET_SYS}/lib/*, so mv will fail.

The fix may be either reverting this commit, or putting the file to ${baselib} instead of lib. I'd like to get your input before going further.

Regards
Ke

Quoted 22 lines · Kumar Gala

Rather than tweaking MULTILIB_DIRNAMES& MULTILIB_OSDIRNAMES like is done for x86-64 via 64bithack.patch. We can just go with gcc defaults and utilize ${base_lib} for where to find gcc libs.

---
 .../gcc/gcc-cross-intermediate.inc                 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
meta/recipes-devtools/gcc/gcc-cross-intermediate.inc +1 -1
index df5958a..7b1bb38 100644
@@ -34,7 +34,7 @@ do_compile () {
 do_install () {
 	oe_runmake 'DESTDIR=${D}' install
 	install -d ${D}${target_base_libdir}/
-	mv ${D}${exec_prefix}/${TARGET_SYS}/lib/* ${D}${target_base_libdir}/
+	mv ${D}${exec_prefix}/${TARGET_SYS}/${baselib}/* ${D}${target_base_libdir}/
 
 	# We don't really need this (here shares/ contains man/, info/, locale/).
 	rm -rf ${D}${datadir}/
#5 lore raw

Ok, CC Richard to see if it is OK to not use 64bithack.patch

Regards
Ke

Quoted 57 lines · Kumar Gala

revert this is not acceptable as that will break ppc64 builds.

I think you need to look at 64bithack.patch and if we really should be using it for multilib builds.

- k

Quoted 40 lines · Yu Ke

Hi Kumar,

I just found this patch breaks the qemux86-64 lib64 multilib build.

the error log is as below:

| mv: cannot stat `/home/kyu3/sdb/multilib2/tmp/work/x86_64-pokymllib64-linux/lib64-gcc-cross-intermediate-4.6.1+svnr175454-r4/image/home/kyu3/sdb/multilib2/tmp/sysroots/x86_64-linux/usr/x86_64-pokymllib64-linux/lib64/*': No such file or directory
NOTE: package lib64-gcc-cross-intermediate-4.6.1+svnr175454-r4: task do_install: Failed
ERROR: Task 1557 (virtual:multilib:lib64:/home/kyu3/src/poky/meta/recipes-devtools/gcc/gcc-cross-intermediate_4.6.bb, do_install) failed with exit code

the error is caused by command in gcc-cross-intermediate.inc: do_install(): "mv ${D}${exec_prefix}/${TARGET_SYS}/${baselib}/* ${D}${target_base_libdir}/"

and the reason is that: ${baselib} is lib64 in multilib case, while the files to be moved is still in ${D}${exec_prefix}/${TARGET_SYS}/lib/*, so mv will fail.

The fix may be either reverting this commit, or putting the file to ${baselib} instead of lib. I'd like to get your input before going further.

Regards
Ke

Quoted 20 lines · Kumar Gala

Rather than tweaking MULTILIB_DIRNAMES& MULTILIB_OSDIRNAMES like is
done for x86-64 via 64bithack.patch. We can just go with gcc defaults and utilize ${base_lib} for where to find gcc libs.

---
  .../gcc/gcc-cross-intermediate.inc                 |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
meta/recipes-devtools/gcc/gcc-cross-intermediate.inc +1 -1
index df5958a..7b1bb38 100644
@@ -34,7 +34,7 @@ do_compile () {
  do_install () {
  	oe_runmake 'DESTDIR=${D}' install
  	install -d ${D}${target_base_libdir}/
-	mv ${D}${exec_prefix}/${TARGET_SYS}/lib/* ${D}${target_base_libdir}/
+	mv ${D}${exec_prefix}/${TARGET_SYS}/${baselib}/* ${D}${target_base_libdir}/
 
Quoted 2 lines

meta/recipes-devtools/gcc/gcc-cross-intermediate.inc do_compile () { · line 40

Quoted 2 lines
meta/recipes-devtools/gcc/gcc-cross-intermediate.inc +0 -0
  	# We don't really need this (here shares/ contains man/, info/, locale/).
  	rm -rf ${D}${datadir}/

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

#6 lore raw
Quoted 10 lines · Yu Ke

Ok, CC Richard to see if it is OK to not use 64bithack.patch

Regards
Ke

Quoted 4 lines · Kumar Gala

revert this is not acceptable as that will break ppc64 builds.

I think you need to look at 64bithack.patch and if we really should be using it for multilib builds.

I think it could be conditionally applied only for non multilib builds but I would be in favour of removing it if not much will break in non multilib case.

Quoted 75 lines
Quoted 59 lines

- k

Quoted 55 lines · Yu Ke

Hi Kumar,

I just found this patch breaks the qemux86-64 lib64 multilib build.

the error log is as below:

| mv: cannot stat
| `/home/kyu3/sdb/multilib2/tmp/work/x86_64-pokymllib64-linux/lib64
| -gcc-cross-intermediate-4.6.1+svnr175454-r4/image/home/kyu3/sdb/mu
| ltilib2/tmp/sysroots/x86_64-linux/usr/x86_64-pokymllib64-linux/lib
| 64/*': No such file or directory>> 

NOTE: package lib64-gcc-cross-intermediate-4.6.1+svnr175454-r4: task
do_install: Failed ERROR: Task 1557 (virtual:multilib:lib64:/home/kyu3/src/poky/meta/recipes-devtools/gcc /gcc-cross-intermediate_4.6.bb, do_install) failed with exit code

the error is caused by command in gcc-cross-intermediate.inc:
do_install(): "mv ${D}${exec_prefix}/${TARGET_SYS}/${baselib}/* ${D}${target_base_libdir}/"

and the reason is that: ${baselib} is lib64 in multilib case, while the files to be moved is still in ${D}${exec_prefix}/${TARGET_SYS}/lib/*, so mv will fail.

The fix may be either reverting this commit, or putting the file to ${baselib} instead of lib. I'd like to get your input before going further.

Regards
Ke

Quoted 24 lines · Kumar Gala

Rather than tweaking MULTILIB_DIRNAMES& MULTILIB_OSDIRNAMES like
is
done for x86-64 via 64bithack.patch. We can just go with gcc defaults
and utilize ${base_lib} for where to find gcc libs.

---

  .../gcc/gcc-cross-intermediate.inc                 |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
(quoted diff) +0 -0

b/meta/recipes-devtools/gcc/gcc-cross-intermediate.inc index df5958a..7b1bb38 100644

meta/recipes-devtools/gcc/gcc-cross-intermediate.inc +0 -0
@@ -34,7 +34,7 @@ do_compile () {
 
  do_install () {
 
  	oe_runmake 'DESTDIR=${D}' install
  	install -d ${D}${target_base_libdir}/
 
Quoted 11 lines
Quoted 6 lines
Quoted 6 lines
meta/recipes-devtools/gcc/gcc-cross-intermediate.inc +0 -1
-	mv ${D}${exec_prefix}/${TARGET_SYS}/lib/*

${D}${target_base_libdir}/

meta/recipes-devtools/gcc/gcc-cross-intermediate.inc +1 -0
+	mv ${D}${exec_prefix}/${TARGET_SYS}/${baselib}/*

${D}${target_base_libdir}/>>>
# We don't really need this (here shares/ contains man/, info/, locale/). rm -rf ${D}${datadir}/

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

#7 lore raw
In reply to Kumar Gala
Quoted 3 lines · Kumar Gala

revert this is not acceptable as that will break ppc64 builds.

I think you need to look at 64bithack.patch and if we really should be using it for multilib builds.

This just sounds like gcc totally ignores the the library directory we're using and that is plain wrong :(.

I'd much prefer gcc didn't make assumptions in this case and did what were were configuring it to do. That is why there is that 64bit hack there and I think gcc should be honouring however we configure the library directories, not doing what it thinks is best...

Cheers,

Richard

#8 lore raw
Quoted 5 lines · Richard Purdie
Quoted 3 lines · Kumar Gala

revert this is not acceptable as that will break ppc64 builds.

I think you need to look at 64bithack.patch and if we really should be using it for multilib builds.

Quoted 7 lines

This just sounds like gcc totally ignores the the library directory we're using and that is plain wrong :(.

I'd much prefer gcc didn't make assumptions in this case and did what were were configuring it to do. That is why there is that 64bit hack there and I think gcc should be honouring however we configure the library directories, not doing what it thinks is best...

I did more digging and this really just highlights why we have that 64bit "hack" patch in the first place.

GCC has internal multilib 'magic' which assumes certain library layout in the 64 bit case. The implication is if you build 64 bit, you cannot have baselib != "lib64". Whilst I can understand this on desktop system, I'd suggest our build system has a better idea what its doing than most and can cope without hardcoding things.

This is why the default builds in the gcc config are set to "." by that patch, that respects whatever base_libdir is set to. I'd suggest we do this for x86, pcc and mips 64 bit and revert the origin baselib patch, but this time better improve the patch documentation about why this is necessary.

Cheers,

Richard

author
#9 lore raw
Quoted 29 lines · Richard Purdie
Quoted 5 lines · Richard Purdie
Quoted 3 lines · Kumar Gala

revert this is not acceptable as that will break ppc64 builds.

I think you need to look at 64bithack.patch and if we really should be using it for multilib builds.

Quoted 7 lines

This just sounds like gcc totally ignores the the library directory we're using and that is plain wrong :(.

I'd much prefer gcc didn't make assumptions in this case and did what were were configuring it to do. That is why there is that 64bit hack there and I think gcc should be honouring however we configure the library directories, not doing what it thinks is best...

I did more digging and this really just highlights why we have that 64bit "hack" patch in the first place.

GCC has internal multilib 'magic' which assumes certain library layout in the 64 bit case. The implication is if you build 64 bit, you cannot have baselib != "lib64". Whilst I can understand this on desktop system, I'd suggest our build system has a better idea what its doing than most and can cope without hardcoding things.

This is why the default builds in the gcc config are set to "." by that patch, that respects whatever base_libdir is set to. I'd suggest we do this for x86, pcc and mips 64 bit and revert the origin baselib patch, but this time better improve the patch documentation about why this is necessary.

Quoted 3 lines

Cheers,

Richard

Khem had some feelings on this so I'll let him chime in

- k