rcn-ee / repos

repos.rcn-ee.com
40 stars 30 forks source link

Update PRU gcc and binutils #37

Closed dinuxbg closed 6 years ago

dinuxbg commented 6 years ago

New major version with better ABI support.

FYI: Building pru-gcc debian package on my QEMU arm chroot takes a few days. I'm still waiting for it to finish, but I don't expect problems at this point. I've tested the x85_64 debian packages. Let me know if you find a build issue.

Signed-off-by: Dimitar Dimitrov dimitar@dinux.eu

dinuxbg commented 6 years ago

Thanks for merging this.

FYI, pru-gcc build successfully finished on my QEMU arm. I used debian stretch armhf host.

dinuxbg commented 6 years ago

@RobertCNelson , I don't see the new packages on my Beaglebone Debian Stretch after "apt update; apt upgrade". Is there a build issue I can help with?

Electron752 commented 6 years ago

Hi,

I know how to setup debian packages so that they can be built with the cross compilers that are standard in stretch, buster, and sid. Any chance a patch would be helpful here. I know building in a QEMU environment is very, very slow...

Also, I have some ARM boards from a competitor to the Beagle. It has a quad core arm that runs at 1GHz. I might be good for building packages if a cross compiler doesn't work.

dinuxbg commented 6 years ago

@Electron752 , I'm not sure how a patch would help here. The pull request has already been merged. @RobertCNelson now should find a time slot to rebuild and publish the packages in his private apt repository.

RobertCNelson commented 6 years ago

@dinuxbg & @Electron752 yeah i'm way behind with beagle things, busy at day job. I'm fighting a build error that doesn't make sense. ;)

+------------------------------------------------------------------------------+
| Build                                                                        |
+------------------------------------------------------------------------------+

Unpack source
-------------

dpkg-source: warning: extracting unsigned source package (binutils-pru_2.30.51.20180310~jessie+20180320.dsc)
dpkg-source: info: extracting binutils-pru in /<<BUILDDIR>>/binutils-pru-2.30.51.20180310~jessie+20180320
dpkg-source: info: unpacking binutils-pru_2.30.51.20180310~jessie+20180320.tar.gz

Check disk space
----------------

df: Warning: cannot read table of mounted file systems: No such file or directory
Sufficient free space for build

User Environment
----------------

APT_CONFIG=/var/lib/sbuild/apt.conf
HOME=/sbuild-nonexistent
LANG=en_US.UTF-8
LC_ALL=POSIX
LOGNAME=root
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
SCHROOT_ALIAS_NAME=jessie-armhf-sbuild
SCHROOT_CHROOT_NAME=jessie-armhf-sbuild
SCHROOT_COMMAND=env
SCHROOT_GID=0
SCHROOT_GROUP=root
SCHROOT_SESSION_ID=jessie-armhf-sbuild-e4de7ab0-05f5-4556-a6a3-a3bc2fb558bf
SCHROOT_UID=0
SCHROOT_USER=root
SHELL=/bin/sh
USER=root

dpkg-buildpackage
-----------------

dpkg-buildpackage: warning: using a gain-root-command while being root
dpkg-buildpackage: source package binutils-pru
dpkg-buildpackage: source version 2.30.51.20180310~jessie+20180320
dpkg-buildpackage: source distribution jessie
dpkg-buildpackage: source changed by Robert Nelson <robertcnelson@gmail.com>
 dpkg-source --before-build binutils-pru-2.30.51.20180310~jessie+20180320
dpkg-buildpackage: host architecture armhf
 fakeroot debian/rules clean
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp a.out unpack-stamp patch-stamp
# Add here commands to clean up after the build process.
#-/usr/bin/make clean
rm -rf src 
#rm binutils-2.18.tar.bz2 
dh_clean
dh_clean: Compatibility levels before 9 are deprecated (level 5 in use)
 dpkg-source -b binutils-pru-2.30.51.20180310~jessie+20180320
dpkg-source: warning: no source format specified in debian/source/format, see dpkg-source(1)
dpkg-source: info: using source format `1.0'
dpkg-source: info: building binutils-pru in binutils-pru_2.30.51.20180310~jessie+20180320.tar.gz
dpkg-source: info: building binutils-pru in binutils-pru_2.30.51.20180310~jessie+20180320.dsc
 debian/rules build
tar xjf binutils-pru_*.tar.bz2
tar: binutils-pru_2.30.51.20180310.tar.bz2: Not found in archive
tar: Exiting with failure status due to previous errors
debian/rules:42: recipe for target 'unpack-stamp' failed
make: *** [unpack-stamp] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
--------------------------------------------------------------------------------
Build finished at 2018-03-20T14:19:33Z

Finished
--------

+------------------------------------------------------------------------------+
| Cleanup                                                                      |
+------------------------------------------------------------------------------+

Purging /<<BUILDDIR>>
Not cleaning session: cloned chroot in use
E: Build failure (dpkg-buildpackage died)

+------------------------------------------------------------------------------+
| Summary                                                                      |
+------------------------------------------------------------------------------+

Build Architecture: armhf
Build Type: full
Build-Space: 82780
Build-Time: 55
Distribution: jessie
Fail-Stage: build
Host Architecture: armhf
Install-Time: 43
Job: binutils-pru_2.30.51.20180310~jessie+20180320.dsc
Machine Architecture: armhf
Package: binutils-pru
Package-Time: 139
Source-Version: 2.30.51.20180310~jessie+20180320
Space: 82780
Status: attempted
Version: 2.30.51.20180310~jessie+20180320
--------------------------------------------------------------------------------
Finished at 2018-03-20T14:19:33Z
Build needed 00:02:19, 82780k disk space
Electron752 commented 6 years ago

It looks like the issue is that binutils-pru_2.30.51.20180310.tar.bz2 wasn't found in the archive.

It seems like the build process assumes that the script download-and-patch.sh should get run before the debian build process to download the original GCC sources. I don't see where it gets run in the debian rules files. It may also be possible that network access has been disabled on the build machine for security purposes. Any chance pbuilder is being used for the build?

I realize I'm someone that came from under a rock here, but perhaps it would be easier to include the entire GCC source in the github tree. That way people wouldn't need to have network access during the build.

One method I use myself when making small personal changes to large open source applications is to maintain two github branches. Say gcc-xyz-orignal and gcc-xyz-modified. Then when I rebase onto a new version, I leave the old branches around and create two new branches automatically by using "git rebase".

I've also heard of the tool git-annex but I haven't used it.

RobertCNelson commented 6 years ago

@Electron752 so here's where things get interesting:

Here's the incoming directory for that build:

http://gfnd.rcn-ee.org:81/farm/incoming/jessie/binutils-pru_2.30.51.20180310/

and here's the file: http://gfnd.rcn-ee.org:81/farm/incoming/jessie/binutils-pru_2.30.51.20180310/binutils-pru_2.30.51.20180310~jessie+20180320.tar.gz

image

yeah.. ;)

dinuxbg commented 6 years ago
tar xjf binutils-pru_*.tar.bz2
tar: binutils-pru_2.30.51.20180310.tar.bz2: Not found in archive

@RobertCNelson , the above error message seems to indicate that there are two or more .tar.bz2 archives. In such case the wildcard would match several .tar.bz2 archives, leading "tar" to believe that the second one is path for extraction. I am not sure how you could end up with two archives, though.

@Electron752: I already package full source tarballs for major releases. See https://github.com/rcn-ee/repos/blob/master/binutils-pru/generate_source.sh

Electron752 commented 6 years ago

I ran the source package through pbuilder on my local machine and at least for amd64 it builds just fine. build.log

Since this is just the binutils I can try running it through pbuilder on a BBB. It might take awhile to do the build though.

IMHO: I still think it would simpler and easier to understand if the bz2 was removed from the build process. Meaning the submitted dsc and gz just had the files loose. To build an archive like that I just run:

dpkg-source --build

Like I said just for clarity sake.

Electron752 commented 6 years ago

I was able to also build the package on a Beagle Bone Black using pbuilder and it built from there as well. So it sounds like this is something subtle with the build environment. So that's probably about as much as I can help here.

The whole reason I posted was that I noticed this project on the web and am considering contributing. Sorry for butting in.

RobertCNelson commented 6 years ago

reque-ed'....

+------------------------------------------------------------------------------+
| Build                                                                        |
+------------------------------------------------------------------------------+

Unpack source
-------------

dpkg-source: warning: extracting unsigned source package (binutils-pru_2.30.51.20180310-0rcnee0~jessie+20180424.dsc)
dpkg-source: info: extracting binutils-pru in /<<PKGBUILDDIR>>
dpkg-source: info: unpacking binutils-pru_2.30.51.20180310-0rcnee0~jessie+20180424.tar.gz

Check disk space
----------------

df: Warning: cannot read table of mounted file systems: No such file or directory
Sufficient free space for build

User Environment
----------------

APT_CONFIG=/var/lib/sbuild/apt.conf
HOME=/sbuild-nonexistent
LANG=en_US.UTF-8
LC_ALL=POSIX
LOGNAME=root
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
SCHROOT_ALIAS_NAME=jessie-armhf-sbuild
SCHROOT_CHROOT_NAME=jessie-armhf-sbuild
SCHROOT_COMMAND=env
SCHROOT_GID=0
SCHROOT_GROUP=root
SCHROOT_SESSION_ID=jessie-armhf-sbuild-a8e4271b-7b9c-4342-a430-651d530570d8
SCHROOT_UID=0
SCHROOT_USER=root
SHELL=/bin/sh
USER=root

dpkg-buildpackage
-----------------

dpkg-buildpackage: warning: using a gain-root-command while being root
dpkg-buildpackage: source package binutils-pru
dpkg-buildpackage: source version 2.30.51.20180310-0rcnee0~jessie+20180424
dpkg-buildpackage: source distribution jessie
dpkg-buildpackage: source changed by Robert Nelson <robertcnelson@gmail.com>
 dpkg-source --before-build binutils-pru-2.30.51.20180310
dpkg-buildpackage: host architecture armhf
 fakeroot debian/rules clean
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp a.out unpack-stamp patch-stamp
# Add here commands to clean up after the build process.
#-/usr/bin/make clean
rm -rf src 
#rm binutils-2.18.tar.bz2 
dh_clean
dh_clean: Compatibility levels before 9 are deprecated (level 5 in use)
 dpkg-source -b binutils-pru-2.30.51.20180310
dpkg-source: warning: no source format specified in debian/source/format, see dpkg-source(1)
dpkg-source: info: using source format `1.0'
dpkg-source: info: building binutils-pru in binutils-pru_2.30.51.20180310-0rcnee0~jessie+20180424.tar.gz
dpkg-source: info: building binutils-pru in binutils-pru_2.30.51.20180310-0rcnee0~jessie+20180424.dsc
 debian/rules build
tar xjf binutils-pru_*.tar.bz2
tar: binutils-pru_2.30.51.20180310.tar.bz2: Not found in archive
tar: Exiting with failure status due to previous errors
debian/rules:42: recipe for target 'unpack-stamp' failed
make: *** [unpack-stamp] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
--------------------------------------------------------------------------------
Build finished at 2018-04-25T01:55:48Z

Finished
--------

+------------------------------------------------------------------------------+
| Cleanup                                                                      |
+------------------------------------------------------------------------------+

Purging /<<BUILDDIR>>
Not cleaning session: cloned chroot in use
E: Build failure (dpkg-buildpackage died)

+------------------------------------------------------------------------------+
| Summary                                                                      |
+------------------------------------------------------------------------------+

Build Architecture: armhf
Build Type: full
Build-Space: 82360
Build-Time: 55
Distribution: jessie
Fail-Stage: build
Host Architecture: armhf
Install-Time: 74
Job: binutils-pru_2.30.51.20180310-0rcnee0~jessie+20180424.dsc
Machine Architecture: armhf
Package: binutils-pru
Package-Time: 186
Source-Version: 2.30.51.20180310-0rcnee0~jessie+20180424
Space: 82360
Status: attempted
Version: 2.30.51.20180310-0rcnee0~jessie+20180424
--------------------------------------------------------------------------------
Finished at 2018-04-25T01:55:48Z
Build needed 00:03:06, 82360k disk space
E: Build failure (dpkg-buildpackage died)
voodoo@b2-am57xx-beagle-x15-2gb:~/repos/binutils-pru$
RobertCNelson commented 6 years ago

okay added more debugging, and now it's building..

#-/usr/bin/make clean
rm -rf src 
#rm binutils-2.18.tar.bz2 
dh_clean
dh_clean: Compatibility levels before 9 are deprecated (level 5 in use)
 dpkg-source -b binutils-pru-2.30.51.20180310
dpkg-source: warning: no source format specified in debian/source/format, see dpkg-source(1)
dpkg-source: info: using source format `1.0'
dpkg-source: info: building binutils-pru in binutils-pru_2.30.51.20180310-0rcnee1~jessie+20180424.tar.gz
dpkg-source: info: building binutils-pru in binutils-pru_2.30.51.20180310-0rcnee1~jessie+20180424.dsc
 debian/rules build
ls
binutils-pru_2.30.51.20180310.tar.bz2
debian
tar xjf binutils-pru_*.tar.bz2
mv `ls -d binutils* | grep -v tar` src
#mkdir build
touch unpack-stamp
cd src && for p in `cat ../debian/patchlist`; do echo; echo Applying $p ...; patch -p1 < ../debian/$p; done
touch patch-stamp
dh_testdir
# Add here commands to configure the package.
#cd src/ld && aclocal-1.9 && automake-1.9 
#cd src && env CC="gcc" CFLAGS="-Wno-error=unused-but-set-variable -Wno-error=unused-but-set-parameter" ./configure --prefix=/usr --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=pru --with-gnu-ld --with-gnu-as --disable-gdb --enable-install-libbfd --with-bugurl="https://github.com/dinuxbg/gnupru/issues" CFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security" CPPFLAGS="-D_FORTIFY_SOURCE=2" CXXFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security" FCFLAGS="-g -O2 -fstack-protector-strong" FFLAGS="-g -O2 -fstack-protector-strong" GCJFLAGS="-g -O2 -fstack-protector-strong" LDFLAGS="-Wl,-z,relro" OBJCFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security" OBJCXXFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security" 
RobertCNelson commented 6 years ago

and finally pushed out to: jessie/stretch/buster and bionic

dinuxbg commented 6 years ago

Thank you.