New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gcc fails to build [buildbot,replicated] #2244

Closed
plntyk opened this Issue Jan 6, 2016 · 29 comments

Comments

Projects
None yet
@plntyk
Contributor

plntyk commented Jan 6, 2016

gcc is failing on several targets:

Package gcc is missing dependencies for the following libraries:
libc.so.6
libm.so.6

This dependency looks wrong (other musl binaries use "libc.so")

Culprit is libcc1.so.0.0.0
It seems wrong that this library is copied from the OpenWrt toolchain dir of GCC5 and then used in GCC 4.8.3.

another issue: --disable-libsanitizer might be useful

@plntyk

This comment has been minimized.

Show comment
Hide comment
@plntyk

plntyk Jan 6, 2016

Contributor

libcc1 is not part of GCC 4.8.3. So copying it is obviously wrong.

Contributor

plntyk commented Jan 6, 2016

libcc1 is not part of GCC 4.8.3. So copying it is obviously wrong.

@courtjestr

This comment has been minimized.

Show comment
Hide comment
@courtjestr

courtjestr Jan 10, 2016

If you change the GCC compiler Version in the toolchain options from gcc 5.x to gcc 4.8.x with Linaro enhancements then gcc builds successfully.

courtjestr commented Jan 10, 2016

If you change the GCC compiler Version in the toolchain options from gcc 5.x to gcc 4.8.x with Linaro enhancements then gcc builds successfully.

@jow-

This comment has been minimized.

Show comment
Hide comment
@jow-

jow- Jan 12, 2016

Contributor
Contributor

jow- commented Jan 12, 2016

@dmamalis

This comment has been minimized.

Show comment
Hide comment
@dmamalis

dmamalis Jan 19, 2016

I have successfully built the default configuration for the ar71xx, however a custom configuration of mine does fail with the same dependency problem. Since this is a gcc dependency how does it not come up during the default configuration built?

@courtjestr unfortunately your proposal doesn't seem to solve the problem. I still get the same dependency error.

dmamalis commented Jan 19, 2016

I have successfully built the default configuration for the ar71xx, however a custom configuration of mine does fail with the same dependency problem. Since this is a gcc dependency how does it not come up during the default configuration built?

@courtjestr unfortunately your proposal doesn't seem to solve the problem. I still get the same dependency error.

@xypron

This comment has been minimized.

Show comment
Hide comment
@xypron

xypron Jan 23, 2016

Contributor

Package GCC should always compile the same version of GCC as the toolchain to ensure ABI compatibility. For instance the C++ ABI of gcc 5.2 is incompatible to gcc 4.8.3.

Hence in the Makefile we have to evaluate GCC_VERSION to decide which version of GCC we compile. See toolchain/gcc/common.mk.

Furthermore we should ensure that we use the same flags. E.g. if for the ARM architecture we compile the toolchain with --hard-float we should do so in package GCC too (cf. common.mk).

Contributor

xypron commented Jan 23, 2016

Package GCC should always compile the same version of GCC as the toolchain to ensure ABI compatibility. For instance the C++ ABI of gcc 5.2 is incompatible to gcc 4.8.3.

Hence in the Makefile we have to evaluate GCC_VERSION to decide which version of GCC we compile. See toolchain/gcc/common.mk.

Furthermore we should ensure that we use the same flags. E.g. if for the ARM architecture we compile the toolchain with --hard-float we should do so in package GCC too (cf. common.mk).

@bk138

This comment has been minimized.

Show comment
Hide comment
@bk138

bk138 Jan 31, 2016

Contributor

Hey, are we talking about different issues here? I can't build gcc because another package, namely 'toolchain' fails to build libgcc:
make package/gcc/compile V=s make[1]: Entering directory '/home/bk/Projekte/PROGGA/00shoutr/openwrt-trunk' make[2]: Entering directory '/home/bk/Projekte/PROGGA/00shoutr/openwrt-trunk/package/libs/toolchain' mkdir -p /home/bk/Projekte/PROGGA/00shoutr/openwrt-trunk/bin/ar71xx/packages /home/bk/Projekte/PROGGA/00shoutr/openwrt-trunk/build_dir/target-mips_34kc_musl-1.1.12/toolchain/ipkg-ar71xx/libgcc/CONTROL /home/bk/Projekte/PROGGA/00shoutr/openwrt-trunk/staging_dir/target-mips_34kc_musl-1.1.12/pkginfo install -d -m0755 /home/bk/Projekte/PROGGA/00shoutr/openwrt-trunk/build_dir/target-mips_34kc_musl-1.1.12/toolchain/ipkg-ar71xx/libgcc/lib cp -fpR /home/bk/Projekte/PROGGA/00shoutr/openwrt-trunk/staging_dir/toolchain-mips_34kc_gcc-5.2.0_musl-1.1.12/lib/libgcc_s.so.* /home/bk/Projekte/PROGGA/00shoutr/openwrt-trunk/build_dir/target-mips_34kc_musl-1.1.12/toolchain/ipkg-ar71xx/libgcc/lib/ cp: cannot stat '/home/bk/Projekte/PROGGA/00shoutr/openwrt-trunk/staging_dir/toolchain-mips_34kc_gcc-5.2.0_musl-1.1.12/lib/libgcc_s.so.*': No such file or directory Makefile:580: recipe for target '/home/bk/Projekte/PROGGA/00shoutr/openwrt-trunk/bin/ar71xx/packages/base/libgcc_unknown-1_ar71xx.ipk' failed make[2]: *** [/home/bk/Projekte/PROGGA/00shoutr/openwrt-trunk/bin/ar71xx/packages/base/libgcc_unknown-1_ar71xx.ipk] Error 1 make[2]: Leaving directory '/home/bk/Projekte/PROGGA/00shoutr/openwrt-trunk/package/libs/toolchain' package/Makefile:191: recipe for target 'package/libs/toolchain/compile' failed make[1]: *** [package/libs/toolchain/compile] Error 2 make[1]: Leaving directory '/home/bk/Projekte/PROGGA/00shoutr/openwrt-trunk' /home/bk/Projekte/PROGGA/00shoutr/openwrt-trunk/include/toplevel.mk:191: recipe for target 'package/gcc/compile' failed make: *** [package/gcc/compile] Error 2

Contributor

bk138 commented Jan 31, 2016

Hey, are we talking about different issues here? I can't build gcc because another package, namely 'toolchain' fails to build libgcc:
make package/gcc/compile V=s make[1]: Entering directory '/home/bk/Projekte/PROGGA/00shoutr/openwrt-trunk' make[2]: Entering directory '/home/bk/Projekte/PROGGA/00shoutr/openwrt-trunk/package/libs/toolchain' mkdir -p /home/bk/Projekte/PROGGA/00shoutr/openwrt-trunk/bin/ar71xx/packages /home/bk/Projekte/PROGGA/00shoutr/openwrt-trunk/build_dir/target-mips_34kc_musl-1.1.12/toolchain/ipkg-ar71xx/libgcc/CONTROL /home/bk/Projekte/PROGGA/00shoutr/openwrt-trunk/staging_dir/target-mips_34kc_musl-1.1.12/pkginfo install -d -m0755 /home/bk/Projekte/PROGGA/00shoutr/openwrt-trunk/build_dir/target-mips_34kc_musl-1.1.12/toolchain/ipkg-ar71xx/libgcc/lib cp -fpR /home/bk/Projekte/PROGGA/00shoutr/openwrt-trunk/staging_dir/toolchain-mips_34kc_gcc-5.2.0_musl-1.1.12/lib/libgcc_s.so.* /home/bk/Projekte/PROGGA/00shoutr/openwrt-trunk/build_dir/target-mips_34kc_musl-1.1.12/toolchain/ipkg-ar71xx/libgcc/lib/ cp: cannot stat '/home/bk/Projekte/PROGGA/00shoutr/openwrt-trunk/staging_dir/toolchain-mips_34kc_gcc-5.2.0_musl-1.1.12/lib/libgcc_s.so.*': No such file or directory Makefile:580: recipe for target '/home/bk/Projekte/PROGGA/00shoutr/openwrt-trunk/bin/ar71xx/packages/base/libgcc_unknown-1_ar71xx.ipk' failed make[2]: *** [/home/bk/Projekte/PROGGA/00shoutr/openwrt-trunk/bin/ar71xx/packages/base/libgcc_unknown-1_ar71xx.ipk] Error 1 make[2]: Leaving directory '/home/bk/Projekte/PROGGA/00shoutr/openwrt-trunk/package/libs/toolchain' package/Makefile:191: recipe for target 'package/libs/toolchain/compile' failed make[1]: *** [package/libs/toolchain/compile] Error 2 make[1]: Leaving directory '/home/bk/Projekte/PROGGA/00shoutr/openwrt-trunk' /home/bk/Projekte/PROGGA/00shoutr/openwrt-trunk/include/toplevel.mk:191: recipe for target 'package/gcc/compile' failed make: *** [package/gcc/compile] Error 2

@KamathKrish

This comment has been minimized.

Show comment
Hide comment
@KamathKrish

KamathKrish Apr 7, 2016

I am hitting the same error. Is this problem unique to me or others still seeing it? This is on openwrt trunk from this week.

Package gcc is missing dependencies for the following libraries: libc.so.6

KamathKrish commented Apr 7, 2016

I am hitting the same error. Is this problem unique to me or others still seeing it? This is on openwrt trunk from this week.

Package gcc is missing dependencies for the following libraries: libc.so.6

@ppelleti

This comment has been minimized.

Show comment
Hide comment
@ppelleti

ppelleti Apr 8, 2016

@KamathKrish, yes, I'm seeing:

Package gcc is missing dependencies for the following libraries:
libc.so.6

after I add --disable-libsanitizer to feeds/packages/devel/gcc/Makefile. (Otherwise, I run into #2581 first.)

ppelleti commented Apr 8, 2016

@KamathKrish, yes, I'm seeing:

Package gcc is missing dependencies for the following libraries:
libc.so.6

after I add --disable-libsanitizer to feeds/packages/devel/gcc/Makefile. (Otherwise, I run into #2581 first.)

@ppelleti

This comment has been minimized.

Show comment
Hide comment
@ppelleti

ppelleti Apr 9, 2016

@courtjestr, how do I change the toolchain compiler version to 4.8.x? When I go to Advanced Configuration Options > Toolchain Options > GCC compiler Version, there is only a single option "gcc 5.x". How do I get 4.8.x to appear as a choice there?

ppelleti commented Apr 9, 2016

@courtjestr, how do I change the toolchain compiler version to 4.8.x? When I go to Advanced Configuration Options > Toolchain Options > GCC compiler Version, there is only a single option "gcc 5.x". How do I get 4.8.x to appear as a choice there?

@bk138

This comment has been minimized.

Show comment
Hide comment
@bk138

bk138 Apr 15, 2016

Contributor

Finally, I can reproduce this myself as well. (--disable-libsanitizer is needed, btw)

@plntyk Yes, copying files over from the toolchain dir is a gross hack and prone to break stuff. As we can see now. This is from the old Makefile from oldpackages and - unfortunately - I can't see an easy way around this as, AFAICT, those crt_.o files are needed by gcc. They do *not_ get installed in $(PKG_INSTALL_DIR) though. Seems to me that the cleanest solution would be to package libgcc as well.

Anyway, I am not using on-target gcc anymore, so am willing to hand over maintenership to someone more intrinsically motivated. If noone steps up, it's okay for me to continue as maintainer, but I definitely need some help with this issue here.

Contributor

bk138 commented Apr 15, 2016

Finally, I can reproduce this myself as well. (--disable-libsanitizer is needed, btw)

@plntyk Yes, copying files over from the toolchain dir is a gross hack and prone to break stuff. As we can see now. This is from the old Makefile from oldpackages and - unfortunately - I can't see an easy way around this as, AFAICT, those crt_.o files are needed by gcc. They do *not_ get installed in $(PKG_INSTALL_DIR) though. Seems to me that the cleanest solution would be to package libgcc as well.

Anyway, I am not using on-target gcc anymore, so am willing to hand over maintenership to someone more intrinsically motivated. If noone steps up, it's okay for me to continue as maintainer, but I definitely need some help with this issue here.

@zyxmon

This comment has been minimized.

Show comment
Hide comment
@zyxmon

zyxmon Apr 18, 2016

Contributor

FYI I compile gcc 5.3.0 package (based on openwrt Makefile) in Entware for arm, mipsel, i386, x86_64 -
https://github.com/Entware-ng/entware-packages/tree/master/devel/gcc

Contributor

zyxmon commented Apr 18, 2016

FYI I compile gcc 5.3.0 package (based on openwrt Makefile) in Entware for arm, mipsel, i386, x86_64 -
https://github.com/Entware-ng/entware-packages/tree/master/devel/gcc

@rkoornstra

This comment has been minimized.

Show comment
Hide comment
@rkoornstra

rkoornstra Apr 26, 2016

I'm using CONFIG_GCC_VERSION="5.3.0"
The default library is now musl.
However, during the build process I see:

Package gcc is missing dependencies for the following libraries:
libc.so.6

It seems some patches are needed to apply to gcc before compiling gcc?
Where is a good place to put patches in the build tree to be applied before compiling gcc?
Thanks,

Reinoud

rkoornstra commented Apr 26, 2016

I'm using CONFIG_GCC_VERSION="5.3.0"
The default library is now musl.
However, during the build process I see:

Package gcc is missing dependencies for the following libraries:
libc.so.6

It seems some patches are needed to apply to gcc before compiling gcc?
Where is a good place to put patches in the build tree to be applied before compiling gcc?
Thanks,

Reinoud

@bk138

This comment has been minimized.

Show comment
Hide comment
@bk138

bk138 Apr 26, 2016

Contributor

@rkoornstra Well, the patches dir ;-)

Contributor

bk138 commented Apr 26, 2016

@rkoornstra Well, the patches dir ;-)

@rkoornstra

This comment has been minimized.

Show comment
Hide comment
@rkoornstra

rkoornstra Apr 27, 2016

Reading the release notes for GCC 6.1, MUSL is finally supported.
It can be selected using the new -mmusl option. :)

Another question: First the cross tools are being created, including a cross gcc.
After that we don't need to build gcc again, unless you want gcc on the target system.
Is this an option I can disable?

rkoornstra commented Apr 27, 2016

Reading the release notes for GCC 6.1, MUSL is finally supported.
It can be selected using the new -mmusl option. :)

Another question: First the cross tools are being created, including a cross gcc.
After that we don't need to build gcc again, unless you want gcc on the target system.
Is this an option I can disable?

@noblepepper

This comment has been minimized.

Show comment
Hide comment
@noblepepper

noblepepper May 18, 2016

Contributor

I have a branch that compiles and works fine on mipsel targets at https://github.com/noblepepper/packages/tree/updategccTo5_3

I am working on general clean up and fixing some of the issues raised in this thread but if anyone can test (and maybe fix problems) on other targets I would be very interested in the results.

Hopefully we can come up with something deserving of a pull request to this repository!

Thanks

Contributor

noblepepper commented May 18, 2016

I have a branch that compiles and works fine on mipsel targets at https://github.com/noblepepper/packages/tree/updategccTo5_3

I am working on general clean up and fixing some of the issues raised in this thread but if anyone can test (and maybe fix problems) on other targets I would be very interested in the results.

Hopefully we can come up with something deserving of a pull request to this repository!

Thanks

@bk138

This comment has been minimized.

Show comment
Hide comment
@bk138

bk138 May 26, 2016

Contributor

Please notify me when you're ready @noblepepper. Thanks!

Contributor

bk138 commented May 26, 2016

Please notify me when you're ready @noblepepper. Thanks!

@rmanders

This comment has been minimized.

Show comment
Hide comment
@rmanders

rmanders Jul 26, 2016

I'm having a similar issue while trying to compile for the Raspberry Pi3 profile:

  • Target System: Broadcom BCM27xx
  • Subtarget: BCM2710 based boards
  • OpenWrt trunk commit: 558b38f4b8e615fb5262c94dad7db2071e394ac1
  • Package feeds commit: fb37ae282b4d3dbbd1c1a92b1747a6806b182493

When compiling with the GCC package I get the error:

Package gcc is missing dependencies for the following libraries:
libc.so.6

If there are any ideas on how to work on a fix for this, I'd be happy to test/try it

rmanders commented Jul 26, 2016

I'm having a similar issue while trying to compile for the Raspberry Pi3 profile:

  • Target System: Broadcom BCM27xx
  • Subtarget: BCM2710 based boards
  • OpenWrt trunk commit: 558b38f4b8e615fb5262c94dad7db2071e394ac1
  • Package feeds commit: fb37ae282b4d3dbbd1c1a92b1747a6806b182493

When compiling with the GCC package I get the error:

Package gcc is missing dependencies for the following libraries:
libc.so.6

If there are any ideas on how to work on a fix for this, I'd be happy to test/try it

@paulo-raca

This comment has been minimized.

Show comment
Hide comment
@paulo-raca

paulo-raca Aug 12, 2016

Contributor

Same issue here.
Is there a workaround?

Contributor

paulo-raca commented Aug 12, 2016

Same issue here.
Is there a workaround?

@mozzwald

This comment has been minimized.

Show comment
Hide comment
@mozzwald

mozzwald commented Aug 12, 2016

@paulo-raca

This comment has been minimized.

Show comment
Hide comment
@paulo-raca

paulo-raca Aug 17, 2016

Contributor

Thanks!

Contributor

paulo-raca commented Aug 17, 2016

Thanks!

@bk138

This comment has been minimized.

Show comment
Hide comment
@bk138

bk138 Aug 17, 2016

Contributor

@mozzwald care to file a PR so we can integrate this here?

Contributor

bk138 commented Aug 17, 2016

@mozzwald care to file a PR so we can integrate this here?

@mozzwald

This comment has been minimized.

Show comment
Hide comment
@mozzwald

mozzwald Aug 17, 2016

@bk138 I'm not sure the patch is the correct fix for upstream openwrt-packages. It would not work for boards using other than gcc 5.3. xypron's comment above is likely the best route to take and I dunno how to go about that in the openwrt Makefile.

mozzwald commented Aug 17, 2016

@bk138 I'm not sure the patch is the correct fix for upstream openwrt-packages. It would not work for boards using other than gcc 5.3. xypron's comment above is likely the best route to take and I dunno how to go about that in the openwrt Makefile.

@noblepepper

This comment has been minimized.

Show comment
Hide comment
@noblepepper

noblepepper Sep 25, 2016

Contributor

@bk138 Apologies for the long silence, I've been off in Chaos Calmer world. I just sent a pull request.

I can't dispute xypron's comment about abi's since I ran into compile problems if the package and toolchain don't match so I made them match.

I have tested on mt7688 & mt7628 which are mipsel, while I have only tested "hello world" on my test images but similar images have built an entire AVR toolchain.

It does compile for arm, I picked Broadcom BCM47xx/53xx (ARM) at random, but I don't have hardware to do further testing.

Contributor

noblepepper commented Sep 25, 2016

@bk138 Apologies for the long silence, I've been off in Chaos Calmer world. I just sent a pull request.

I can't dispute xypron's comment about abi's since I ran into compile problems if the package and toolchain don't match so I made them match.

I have tested on mt7688 & mt7628 which are mipsel, while I have only tested "hello world" on my test images but similar images have built an entire AVR toolchain.

It does compile for arm, I picked Broadcom BCM47xx/53xx (ARM) at random, but I don't have hardware to do further testing.

@bk138

This comment has been minimized.

Show comment
Hide comment
@bk138

bk138 Sep 26, 2016

Contributor

@noblepepper thank you very much for this! Care to take over maintainership of this package? As I mentioned earlier, I am not actively using on-target gcc anymore, so someone who actually needs that package might be suited better for the task.

Contributor

bk138 commented Sep 26, 2016

@noblepepper thank you very much for this! Care to take over maintainership of this package? As I mentioned earlier, I am not actively using on-target gcc anymore, so someone who actually needs that package might be suited better for the task.

@noblepepper

This comment has been minimized.

Show comment
Hide comment
@noblepepper

noblepepper Sep 27, 2016

Contributor

I'm not sure how much time will be needed or I can spare but since you aren't using this package anymore I can give "maintainership" a try. Let me know how we go about doing this.

Contributor

noblepepper commented Sep 27, 2016

I'm not sure how much time will be needed or I can spare but since you aren't using this package anymore I can give "maintainership" a try. Let me know how we go about doing this.

@bk138

This comment has been minimized.

Show comment
Hide comment
@bk138

bk138 Sep 27, 2016

Contributor

cool. you just set yourself as maintainer in the makefile. that's it ;-)

Am 27. September 2016 13:41:01 MESZ, schrieb noblepepper notifications@github.com:

I'm not sure how much time will be needed or I can spare but since you
aren't using this package anymore I can give "maintainership" a try.
Let me know how we go about doing this.

You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#2244 (comment)

Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.

Contributor

bk138 commented Sep 27, 2016

cool. you just set yourself as maintainer in the makefile. that's it ;-)

Am 27. September 2016 13:41:01 MESZ, schrieb noblepepper notifications@github.com:

I'm not sure how much time will be needed or I can spare but since you
aren't using this package anymore I can give "maintainership" a try.
Let me know how we go about doing this.

You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#2244 (comment)

Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.

@noblepepper

This comment has been minimized.

Show comment
Hide comment
@noblepepper

noblepepper Sep 28, 2016

Contributor

Done. Is there any thing that needs to be done for handling pull requests, etc?

Contributor

noblepepper commented Sep 28, 2016

Done. Is there any thing that needs to be done for handling pull requests, etc?

@bk138

This comment has been minimized.

Show comment
Hide comment
@bk138

bk138 Sep 28, 2016

Contributor

well lede/openwrt guys will cc you when a pr comes in. you bring in the technical expertise, but as they are owners of the tree, they will have the last word. that's about it.

Contributor

bk138 commented Sep 28, 2016

well lede/openwrt guys will cc you when a pr comes in. you bring in the technical expertise, but as they are owners of the tree, they will have the last word. that's about it.

@hnyman

This comment has been minimized.

Show comment
Hide comment
@hnyman

hnyman Oct 4, 2016

Contributor

gcc has been updated to 5.4.0 and seems to compile ok in buildbots

Contributor

hnyman commented Oct 4, 2016

gcc has been updated to 5.4.0 and seems to compile ok in buildbots

@hnyman hnyman closed this Oct 4, 2016

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