Skip to contentSkip to conversation

toolchain: Add glibc support for ARCv2

PATCH Superseded Alexey Brodkin 2 participants 6 messages Sep 14, 2017 – Oct 5, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover toolchain: Add glibc support for ARCv2

This short series add glibc support for ARCv2 architecture. Support of older ARCompact (AKA ARCv1 ISA) is not there yet but we'll add it soon.

Unfortunately patches in root folder stand in the way for us as our sources as much ahead of 2.25 release so they got moved again in 2.25 folder, sorry for that.

Alexey Brodkin (2):
glibc: Move patches to version-specific folder
toolchain: Add glibc support for ARCv2

 package/glibc/{ => 2.25}/0001-sh-Fix-building-with-gcc5-6.patch    | 0
 ...0002-CVE-2017-1000366-Ignore-LD_LIBRARY_PATH-for-AT_SECUR.patch | 0
 .../0003-ld.so-Reject-overly-long-LD_PRELOAD-path-elements.patch   | 0
 .../0004-ld.so-Reject-overly-long-LD_AUDIT-path-elements.patch     | 0
 package/glibc/{ => 2.25}/0005-fix-binutils-2-29-build.patch        | 0
 ...-i686-Add-missing-IS_IN-libc-guards-to-vectorized-strcspn.patch | 0
 package/glibc/{ => 2.25}/0006-sh4-trap.patch                       | 0
 package/glibc/glibc.hash                                           | 2 ++
 package/glibc/glibc.mk                                             | 7 +++++++
 toolchain/toolchain-buildroot/Config.in                            | 2 +-
 10 files changed, 10 insertions(+), 1 deletion(-)
 rename package/glibc/{ => 2.25}/0001-sh-Fix-building-with-gcc5-6.patch (100%)
 rename package/glibc/{ => 2.25}/0002-CVE-2017-1000366-Ignore-LD_LIBRARY_PATH-for-AT_SECUR.patch (100%)
 rename package/glibc/{ => 2.25}/0003-ld.so-Reject-overly-long-LD_PRELOAD-path-elements.patch (100%)
 rename package/glibc/{ => 2.25}/0004-ld.so-Reject-overly-long-LD_AUDIT-path-elements.patch (100%)
 rename package/glibc/{ => 2.25}/0005-fix-binutils-2-29-build.patch (100%)
 rename package/glibc/{ => 2.25}/0006-i686-Add-missing-IS_IN-libc-guards-to-vectorized-strcspn.patch (100%)
 rename package/glibc/{ => 2.25}/0006-sh4-trap.patch (100%)
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/2 glibc: Move patches to version-specific folder

Removal of other glibc versions was nice but now when we're about to introduce ARC port of glibc which is based on newer glibc sources (pretty much today's master branch) these allways applied patches are getting in the way.

Thus we re-introduce a bit of complication until ARC port becomes a part of upstream glibc release.

Cc Waldemar Brodkorb <[email protected]>
---
 package/glibc/{ => 2.25}/0001-sh-Fix-building-with-gcc5-6.patch           | 0
 .../0002-CVE-2017-1000366-Ignore-LD_LIBRARY_PATH-for-AT_SECUR.patch       | 0
 .../0003-ld.so-Reject-overly-long-LD_PRELOAD-path-elements.patch          | 0
 .../{ => 2.25}/0004-ld.so-Reject-overly-long-LD_AUDIT-path-elements.patch | 0
 package/glibc/{ => 2.25}/0005-fix-binutils-2-29-build.patch               | 0
 .../0006-i686-Add-missing-IS_IN-libc-guards-to-vectorized-strcspn.patch   | 0
 package/glibc/{ => 2.25}/0006-sh4-trap.patch                              | 0
 7 files changed, 0 insertions(+), 0 deletions(-)
 rename package/glibc/{ => 2.25}/0001-sh-Fix-building-with-gcc5-6.patch (100%)
 rename package/glibc/{ => 2.25}/0002-CVE-2017-1000366-Ignore-LD_LIBRARY_PATH-for-AT_SECUR.patch (100%)
 rename package/glibc/{ => 2.25}/0003-ld.so-Reject-overly-long-LD_PRELOAD-path-elements.patch (100%)
 rename package/glibc/{ => 2.25}/0004-ld.so-Reject-overly-long-LD_AUDIT-path-elements.patch (100%)
 rename package/glibc/{ => 2.25}/0005-fix-binutils-2-29-build.patch (100%)
 rename package/glibc/{ => 2.25}/0006-i686-Add-missing-IS_IN-libc-guards-to-vectorized-strcspn.patch (100%)
 rename package/glibc/{ => 2.25}/0006-sh4-trap.patch (100%)
package/glibc/2.25/0001-sh-Fix-building-with-gcc5-6.patch renamed from package/glibc/0001-sh-Fix-building-with-gcc5-6.patch +0 -0
similarity index 100%
rename from package/glibc/0001-sh-Fix-building-with-gcc5-6.patch
rename to package/glibc/2.25/0001-sh-Fix-building-with-gcc5-6.patch
package/glibc/2.25/0002-CVE-2017-1000366-Ignore-LD_LIBRARY_PATH-for-AT_SECUR.patch renamed from package/glibc/0002-CVE-2017-1000366-Ignore-LD_LIBRARY_PATH-for-AT_SECUR.patch +0 -0
similarity index 100%
rename from package/glibc/0002-CVE-2017-1000366-Ignore-LD_LIBRARY_PATH-for-AT_SECUR.patch
rename to package/glibc/2.25/0002-CVE-2017-1000366-Ignore-LD_LIBRARY_PATH-for-AT_SECUR.patch
package/glibc/2.25/0003-ld.so-Reject-overly-long-LD_PRELOAD-path-elements.patch renamed from package/glibc/0003-ld.so-Reject-overly-long-LD_PRELOAD-path-elements.patch +0 -0
similarity index 100%
rename from package/glibc/0003-ld.so-Reject-overly-long-LD_PRELOAD-path-elements.patch
rename to package/glibc/2.25/0003-ld.so-Reject-overly-long-LD_PRELOAD-path-elements.patch
package/glibc/2.25/0004-ld.so-Reject-overly-long-LD_AUDIT-path-elements.patch renamed from package/glibc/0004-ld.so-Reject-overly-long-LD_AUDIT-path-elements.patch +0 -0
similarity index 100%
rename from package/glibc/0004-ld.so-Reject-overly-long-LD_AUDIT-path-elements.patch
rename to package/glibc/2.25/0004-ld.so-Reject-overly-long-LD_AUDIT-path-elements.patch
package/glibc/2.25/0005-fix-binutils-2-29-build.patch renamed from package/glibc/0005-fix-binutils-2-29-build.patch +0 -0
similarity index 100%
rename from package/glibc/0005-fix-binutils-2-29-build.patch
rename to package/glibc/2.25/0005-fix-binutils-2-29-build.patch
package/glibc/2.25/0006-i686-Add-missing-IS_IN-libc-guards-to-vectorized-strcspn.patch renamed from package/glibc/0006-i686-Add-missing-IS_IN-libc-guards-to-vectorized-strcspn.patch +0 -0
similarity index 100%
rename from package/glibc/0006-i686-Add-missing-IS_IN-libc-guards-to-vectorized-strcspn.patch
rename to package/glibc/2.25/0006-i686-Add-missing-IS_IN-libc-guards-to-vectorized-strcspn.patch
package/glibc/2.25/0006-sh4-trap.patch renamed from package/glibc/0006-sh4-trap.patch +0 -0
similarity index 100%
rename from package/glibc/0006-sh4-trap.patch
rename to package/glibc/2.25/0006-sh4-trap.patch
Signature · 1 line
2.11.0
#2 lore raw

PATCH 2/2 toolchain: Add glibc support for ARCv2

In reply to Alexey Brodkin

Finally there's working ARC port of glibc thanks to Vineet and Cuper! This port is based on pretty recent glibc's master branch and ARC changes are being reviewed now in glibc's mailing list.

Thus we again have to use sources from our GitHub but as soon as there's a glibc release with our patches applied we'll switch to unpstream releases and will drop our glibc GitHub repo alltogether.

Note now we cut tags in glibc repo simultaneously with tags
in Binutils and GCC repos and so to make sure everything works in the best way we plan to update glibc tag together with Binutils and GCC.

Also note as of today ARCompact (AKA ARCv1 ISA) is not supported in glibc but we plan to fix it soonish so for now we make glibc intentionally dependent on archs38.

Cc Cupertino Miranda <[email protected]>
Cc Vineet Gupta <[email protected]>
Cc Anton Kolesov <[email protected]>
---
 package/glibc/glibc.hash                | 2 ++
 package/glibc/glibc.mk                  | 7 +++++++
 toolchain/toolchain-buildroot/Config.in | 2 +-
 3 files changed, 10 insertions(+), 1 deletion(-)
package/glibc/glibc.hash +2 -0
index daaf014a00..06b52eb069 100644
@@ -1,2 +1,4 @@
 # Locally calculated after checking pgp signature (glibc)
 sha256	067bd9bb3390e79aa45911537d13c3721f1d9d3769931a30c2681bfee66f23a0	glibc-2.25.tar.xz
+# Locally calculated (fetched from Github)
+sha256	acbc223dea1130e9df2dd839f3311b4d0e3942e9dc833d8a962024cfaceed9c6	glibc-arc-2017.09-eng008.tar.gz
package/glibc/glibc.mk +7 -0
index c9a65796b0..e9570b6a5f 100644
@@ -4,9 +4,16 @@
 #
 ################################################################################
 
+ifeq ($(BR2_arc),y)
+GLIBC_VERSION = arc-2017.09-eng008
+GLIBC_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,glibc,$(GLIBC_VERSION))
+GLIBC_SOURCE = glibc-$(GLIBC_VERSION).tar.gz
+else
 GLIBC_VERSION = 2.25
 GLIBC_SITE = $(BR2_GNU_MIRROR)/libc
 GLIBC_SOURCE = glibc-$(GLIBC_VERSION).tar.xz
+endif
+
 GLIBC_SRC_SUBDIR = .
 
 GLIBC_LICENSE = GPL-2.0+ (programs), LGPL-2.1+, BSD-3-Clause, MIT (library)
toolchain/toolchain-buildroot/Config.in +1 -1
index f47001fcf6..6afd139b59 100644
@@ -47,7 +47,7 @@ config BR2_TOOLCHAIN_BUILDROOT_GLIBC
 		   BR2_mipsel      || BR2_mips64     || BR2_mips64el|| \
 		   BR2_powerpc     || BR2_powerpc64  || BR2_powerpc64le || \
 		   BR2_sh          || BR2_sparc64    || BR2_x86_64 || \
-		   BR2_microblaze || BR2_nios2
+		   BR2_microblaze  || BR2_nios2      || BR2_archs38
 	depends on BR2_USE_MMU
 	depends on !BR2_STATIC_LIBS
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
Signature · 1 line
2.11.0
#3 lore raw

PATCH 2/2 toolchain: Add glibc support for ARCv2

Hi Thomas, Arnout,

Quoted 12 lines · Alexey Brodkin

Finally there's working ARC port of glibc thanks to Vineet and Cuper! This port is based on pretty recent glibc's master branch and ARC changes are being reviewed now in glibc's mailing list.

Thus we again have to use sources from our GitHub but as soon as there's a glibc release with our patches applied we'll switch to unpstream releases and will drop our glibc GitHub repo alltogether.

Note now we cut tags in glibc repo simultaneously with tags
in Binutils and GCC repos and so to make sure everything works in the best way we plan to update glibc tag together with Binutils and GCC.

Quoted 8 lines

Also note as of today ARCompact (AKA ARCv1 ISA) is not supported in glibc but we plan to fix it soonish so for now we make glibc intentionally dependent on archs38.

Cc Cupertino Miranda <[email protected]>
Cc Vineet Gupta <[email protected]>
Cc Anton Kolesov <[email protected]>

This patch was sitting in patchwork for 2 weeks now. If there're any complaints an suggestions why don't we merge it?

I'd like to see how we ramp-up with glibc toolchain for ARC. That said once the patch is applied would be good to add a corresponding config for autobuilder.

-Alexey

#4 lore raw

PATCH 2/2 toolchain: Add glibc support for ARCv2

Quoted 19 lines · Alexey Brodkin

Hi Thomas, Arnout,

Quoted 16 lines · Alexey Brodkin

Finally there's working ARC port of glibc thanks to Vineet and Cuper! This port is based on pretty recent glibc's master branch and ARC changes are being reviewed now in glibc's mailing list.

Thus we again have to use sources from our GitHub but as soon as there's a glibc release with our patches applied we'll switch to unpstream releases and will drop our glibc GitHub repo alltogether.

Note now we cut tags in glibc repo simultaneously with tags
in Binutils and GCC repos and so to make sure everything works in the best way we plan to update glibc tag together with Binutils and GCC.

Also note as of today ARCompact (AKA ARCv1 ISA) is not supported in glibc but we plan to fix it soonish so for now we make glibc intentionally dependent on archs38.

Quoted 7 lines
Quoted 4 lines
Cc Cupertino Miranda <[email protected]>
Cc Vineet Gupta <[email protected]>
Cc Anton Kolesov <[email protected]>

This patch was sitting in patchwork for 2 weeks now. If there're any complaints an suggestions why don't we merge it?

Since I merged the bump to glibc 2.26, patch 1 is not correct anymore.

Would it be useful to instead add patches to our glibc to add ARC support? Or
are the ARC patches too difficult to backport?

Quoted 3 lines

I'd like to see how we ramp-up with glibc toolchain for ARC. That said once the patch is applied would be good to add a corresponding config for autobuilder.

You can actually do that yourself by adding a config to
support/config-fragments/autobuild and updating toolchain-configs.csv in that directory. Something like br-arc-full-internal.config but then with glibc.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#5 lore raw

PATCH 2/2 toolchain: Add glibc support for ARCv2

Hi Arnout,

Quoted 28 lines · Arnout Vandecappelle
Quoted 26 lines · Alexey Brodkin

Hi Thomas, Arnout,

Quoted 21 lines · Alexey Brodkin

Finally there's working ARC port of glibc thanks to Vineet and Cuper! This port is based on pretty recent glibc's master branch and ARC changes are being reviewed now in glibc's mailing list.

Thus we again have to use sources from our GitHub but as soon as there's a glibc release with our patches applied we'll switch to unpstream releases and will drop our glibc GitHub repo alltogether.

Note now we cut tags in glibc repo simultaneously with tags
in Binutils and GCC repos and so to make sure everything works in the best way we plan to update glibc tag together with Binutils and GCC.

Also note as of today ARCompact (AKA ARCv1 ISA) is not supported in glibc but we plan to fix it soonish so for now we make glibc intentionally dependent on archs38.

Cc Cupertino Miranda <[email protected]>
Cc Vineet Gupta <[email protected]>
Cc Anton Kolesov <[email protected]>
Quoted 4 lines
Quoted 2 lines

This patch was sitting in patchwork for 2 weeks now. If there're any complaints an suggestions why don't we merge it?

?Since I merged the bump to glibc 2.26, patch 1 is not correct anymore.

I'll send a respin shortly, OK?

Quoted 2 lines

?Would it be useful to instead add patches to our glibc to add ARC support? Or are the ARC patches too difficult to backport?

Well not now definitely. The point is:
?a) ARC port is not yet merged upstream
?b) Our patches are on top of pretty much up-to-date master branch, ? ? which means they alone won't apply on top of the most recent release

Quoted 10 lines
Quoted 6 lines

I'd like to see how we ramp-up with glibc toolchain for ARC. That said once the patch is applied would be good to add a corresponding config for autobuilder.

?You can actually do that yourself by adding a config to support/config-fragments/autobuild and updating toolchain-configs.csv in that directory. Something like br-arc-full-internal.config but then with glibc.

Sure, will do once glibc for ARC is supported in BR.

-Alexey