[GRASS-dev] problem building 7.2.1RC1 for UbuntuGIS

Hi,

I am trying to solve problem with building 7.2.1RC1 for UbuntuGIS, see [1]:

"""

/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/Scrt1.o: In
function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
../../include/Make/Shlib.make:10: recipe for target
'/<<PKGBUILDDIR>>/dist.x86_64-pc-linux-gnu/lib/libgrass_datetime.7.2.1RC1.so'
failed
make[5]: *** [/<<PKGBUILDDIR>>/dist.x86_64-pc-linux-gnu/lib/libgrass_datetime.7.2.1RC1.so]
Error 1
make[5]: Leaving directory '/<<PKGBUILDDIR>>/lib/datetime'
"""

Any idea by chance? Building via vagrant [2] on xenial works. Thanks, Ma

[1] https://launchpadlibrarian.net/314562052/buildlog_ubuntu-xenial-amd64.grass_7.2.1~rc1-1~exp1~xenial1_BUILDING.txt.gz
[2] https://trac.osgeo.org/grass/browser/grass/branches/releasebranch_7_2/Vagrantfile

--
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.cz/mentors/landa

On 04/08/2017 12:38 PM, Martin Landa wrote:

I am trying to solve problem with building 7.2.1RC1 for UbuntuGIS, see [1]:

"""

/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/Scrt1.o: In
function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
../../include/Make/Shlib.make:10: recipe for target
'/<<PKGBUILDDIR>>/dist.x86_64-pc-linux-gnu/lib/libgrass_datetime.7.2.1RC1.so'
failed
make[5]: *** [/<<PKGBUILDDIR>>/dist.x86_64-pc-linux-gnu/lib/libgrass_datetime.7.2.1RC1.so]
Error 1
make[5]: Leaving directory '/<<PKGBUILDDIR>>/lib/datetime'
"""

That's for this command:

gcc -shared -o
/<<PKGBUILDDIR>>/dist.x86_64-pc-linux-gnu/lib/libgrass_datetime.7.2.1RC1.so
-L/<<PKGBUILDDIR>>/dist.x86_64-pc-linux-gnu/lib
-L/<<PKGBUILDDIR>>/dist.x86_64-pc-linux-gnu/lib -Wl,-Bsymbolic-functions
-fPIE -pie -Wl,-z,relro -Wl,-z,now -Wl,--export-dynamic
-Wl,-rpath-link,/<<PKGBUILDDIR>>/dist.x86_64-pc-linux-gnu/lib
-Wl,-soname,libgrass_datetime.7.2.1RC1.so
OBJ.x86_64-pc-linux-gnu/between.o OBJ.x86_64-pc-linux-gnu/change.o
OBJ.x86_64-pc-linux-gnu/copy.o OBJ.x86_64-pc-linux-gnu/diff.o
OBJ.x86_64-pc-linux-gnu/error.o OBJ.x86_64-pc-linux-gnu/format.o
OBJ.x86_64-pc-linux-gnu/incr1.o OBJ.x86_64-pc-linux-gnu/incr2.o
OBJ.x86_64-pc-linux-gnu/incr3.o OBJ.x86_64-pc-linux-gnu/local.o
OBJ.x86_64-pc-linux-gnu/misc.o OBJ.x86_64-pc-linux-gnu/same.o
OBJ.x86_64-pc-linux-gnu/scan.o OBJ.x86_64-pc-linux-gnu/sign.o
OBJ.x86_64-pc-linux-gnu/type.o OBJ.x86_64-pc-linux-gnu/tz1.o
OBJ.x86_64-pc-linux-gnu/tz2.o OBJ.x86_64-pc-linux-gnu/values.o -lm

Any idea by chance? Building via vagrant [2] on xenial works. Thanks, Ma

None of the objects files have a main() function, which makes sense for
a library. It may be related to PIE, you can try building without it.

You should compare the build logs for the launchpad and vagrant builds.
The differences should help you find the cause.

[1] https://launchpadlibrarian.net/314562052/buildlog_ubuntu-xenial-amd64.grass_7.2.1~rc1-1~exp1~xenial1_BUILDING.txt.gz
[2] https://trac.osgeo.org/grass/browser/grass/branches/releasebranch_7_2/Vagrantfile

Kind Regards,

Bas

--
GPG Key ID: 4096R/6750F10AE88D4AF1
Fingerprint: 8182 DE41 7056 408D 6146 50D1 6750 F10A E88D 4AF1

Hi,

2017-04-08 14:06 GMT+02:00 Sebastiaan Couwenberg <sebastic@xs4all.nl>:

None of the objects files have a main() function, which makes sense for
a library. It may be related to PIE, you can try building without it.

yes, but it's strange that we didn't have any problem when building
7.2.0 release...

Martin

--
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.cz/mentors/landa

On 04/08/2017 06:21 PM, Martin Landa wrote:

2017-04-08 14:06 GMT+02:00 Sebastiaan Couwenberg <sebastic@xs4all.nl>:

None of the objects files have a main() function, which makes sense for
a library. It may be related to PIE, you can try building without it.

yes, but it's strange that we didn't have any problem when building
7.2.0 release...

PIE was disabled then, it was (re-)enabled in 7.2.0-2 now that gcc is
fixed in Debian to handle it properly, see:

https://anonscm.debian.org/cgit/pkg-grass/grass.git/commit/?id=f7d83e8407e477aa77177b5744ece30fed7327d0

https://bugs.debian.org/859372

Ubuntu likely doesn't have these changes yet in releases pre-zesty,
making PIE still problematic there.

If you can confirm that disabling PIE fixes the issue, we can make the
hardening flags conditional and disabled them on Ubuntu.

Kind Regards,

Bas

--
GPG Key ID: 4096R/6750F10AE88D4AF1
Fingerprint: 8182 DE41 7056 408D 6146 50D1 6750 F10A E88D 4AF1

Hi,

2017-04-08 18:42 GMT+02:00 Sebastiaan Couwenberg <sebastic@xs4all.nl>:

PIE was disabled then, it was (re-)enabled in 7.2.0-2 now that gcc is
fixed in Debian to handle it properly, see:

https://anonscm.debian.org/cgit/pkg-grass/grass.git/commit/?id=f7d83e8407e477aa77177b5744ece30fed7327d0

https://bugs.debian.org/859372

Ubuntu likely doesn't have these changes yet in releases pre-zesty,
making PIE still problematic there.

If you can confirm that disabling PIE fixes the issue, we can make the
hardening flags conditional and disabled them on Ubuntu.

thanks for explanation! Disabling PIE helped [1]. Thanks, Martin

[1] https://anonscm.debian.org/cgit/pkg-grass/grass.git/commit/?h=ubuntugis/xenial&id=61046d883838fa34a09a59c881289afdf92dbd88

--
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.cz/mentors/landa

On 04/09/2017 01:07 PM, Martin Landa wrote:

2017-04-08 18:42 GMT+02:00 Sebastiaan Couwenberg <sebastic@xs4all.nl>:

PIE was disabled then, it was (re-)enabled in 7.2.0-2 now that gcc is
fixed in Debian to handle it properly, see:

https://anonscm.debian.org/cgit/pkg-grass/grass.git/commit/?id=f7d83e8407e477aa77177b5744ece30fed7327d0

https://bugs.debian.org/859372

Ubuntu likely doesn't have these changes yet in releases pre-zesty,
making PIE still problematic there.

If you can confirm that disabling PIE fixes the issue, we can make the
hardening flags conditional and disabled them on Ubuntu.

thanks for explanation! Disabling PIE helped [1]. Thanks, Martin

I've updated debian/rules to disable PIE on Ubuntu, see:

https://anonscm.debian.org/cgit/pkg-grass/grass.git/commit/?h=experimental&id=1b6b075ecfdd703e2dad5c309860f86856190b05

Kind Regards,

Bas

--
GPG Key ID: 4096R/6750F10AE88D4AF1
Fingerprint: 8182 DE41 7056 408D 6146 50D1 6750 F10A E88D 4AF1