Skip to content
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

Sage does not build on debian testing #21782

Closed
lftabera opened this issue Oct 29, 2016 · 27 comments
Closed

Sage does not build on debian testing #21782

lftabera opened this issue Oct 29, 2016 · 27 comments

Comments

@lftabera
Copy link
Contributor

In debian testing with gcc-6 Sage does not build. flint fails with ld errors. Debian enables -pie by default on gcc-6 with gcc-5 Sage builds perfectly.

Note that gcc-6 will be the default (only!) compiler in next debian release.

Apparently the flint build fail is already solved in debian

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=837453

I do not know if further problems appear with other packages.

Component: build

Keywords: gcc-6 pie flint

Author: Jörg-Volker Peetz, Emmanuel Charpentier

Branch/Commit: 96442c6

Reviewer: Jeroen Demeyer, François Bissey

Issue created by migration from https://trac.sagemath.org/ticket/21782

@lftabera lftabera added this to the sage-7.5 milestone Oct 29, 2016
@kiwifb
Copy link
Member

kiwifb commented Nov 7, 2016

comment:2

Given the experience I had with various compiler go ahead with the debian patches, the bots will tell us what things fails if any.

@EmmanuelCharpentier
Copy link
Mannequin

EmmanuelCharpentier mannequin commented Nov 7, 2016

Branch: u/charpent/fix-flint

@EmmanuelCharpentier
Copy link
Mannequin

EmmanuelCharpentier mannequin commented Nov 7, 2016

Author: Jörg-Volker, Emmanuel Charpentier

@EmmanuelCharpentier
Copy link
Mannequin

EmmanuelCharpentier mannequin commented Nov 7, 2016

Commit: e2d10c3

@EmmanuelCharpentier
Copy link
Mannequin

EmmanuelCharpentier mannequin commented Nov 7, 2016

comment:4

Patch proposed by someone called "Jörg-Volker" in this post, and packaged by me. Author contacted for complete identity (no answer yet) and credited as such.

  • Allows compilation on Debian with gcc 6.2.0.
  • Passes ptestlong with no errors (not even the usual transiant error on simplicial_complex).
  • Checked by François Bissey on :
    • Gentoo / gcc 5.4.0,
    • OS X / gcc 4.9.3,
    • OS X / clang.

==> needs_review


New commits:

e2d10c3Patches allowing compilation with gcc >= 6.2.x

@kiwifb
Copy link
Member

kiwifb commented Nov 7, 2016

comment:5

Can you inquire about the -r option, what it does, and where is there doc for it?

@jdemeyer
Copy link
Contributor

jdemeyer commented Nov 7, 2016

comment:6

You should bump the patch level in package-version.txt of the packages that you changed.

@jdemeyer
Copy link
Contributor

jdemeyer commented Nov 7, 2016

comment:7

Also this should be fixed:

(Stripping trailing CRs from patch; use --binary to disable.)
patching file Makefile.subdirs
(Stripping trailing CRs from patch; use --binary to disable.)
patching file fq/Makefile
(Stripping trailing CRs from patch; use --binary to disable.)
patching file fq_poly/Makefile
(Stripping trailing CRs from patch; use --binary to disable.)
patching file padic_mat/Makefile
(Stripping trailing CRs from patch; use --binary to disable.)
patching file padic_poly/Makefile
(Stripping trailing CRs from patch; use --binary to disable.)
patching file qadic/Makefile

(both flint and arb patches have the same problem)

@jdemeyer
Copy link
Contributor

jdemeyer commented Nov 7, 2016

comment:8

Seems to work with

gcc (Gentoo 4.9.3 p1.5, pie-0.6.4) 4.9.3
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@jdemeyer
Copy link
Contributor

jdemeyer commented Nov 7, 2016

comment:9

Please document (in the .patch file) where the patch came from.

@jdemeyer
Copy link
Contributor

jdemeyer commented Nov 7, 2016

comment:10

Also works on

Linux sagebu14_32s02 4.7.0-0.bpo.1-amd64 #1 SMP Debian 4.7.8-1~bpo8+1 (2016-10-19) i686 i686 i686 GNU/Linux

with

gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

So, apart from the minor issues with the patch files, this is good for me.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 7, 2016

Branch pushed to git repo; I updated commit sha1. New commits:

1833b35Bump package versions, patch file format nitpicking.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 7, 2016

Changed commit from e2d10c3 to 1833b35

@EmmanuelCharpentier
Copy link
Mannequin

EmmanuelCharpentier mannequin commented Nov 7, 2016

comment:12

Replying to @kiwifb:

Can you inquire about the -r option, what it does, and where is there doc for it?

I'll do that (probably by going directly to the gcc mailing list). But this should not, IMHO, delay the fixing of this blocker bug.

@EmmanuelCharpentier
Copy link
Mannequin

EmmanuelCharpentier mannequin commented Nov 7, 2016

comment:13

Replying to @sagetrac-git:

Branch pushed to git repo; I updated commit sha1. New commits:

1833b35Bump package versions, patch file format nitpicking.

Fulfills comments 6, 7 and 9.

==> needs_review

@EmmanuelCharpentier
Copy link
Mannequin

EmmanuelCharpentier mannequin commented Nov 7, 2016

comment:14

Replying to @EmmanuelCharpentier:

Replying to @kiwifb:

Can you inquire about the -r option, what it does, and where is there doc for it?

I'll do that (probably by going directly to the gcc mailing list). But this should not, IMHO, delay the fixing of this blocker bug.

Done [ https://gcc.gnu.org/ml/gcc/2016-11/msg00014.html here].

@EmmanuelCharpentier
Copy link
Mannequin

EmmanuelCharpentier mannequin commented Nov 7, 2016

comment:15

Replying to @EmmanuelCharpentier:

Replying to @EmmanuelCharpentier:

Replying to @kiwifb:

Can you inquire about the -r option, what it does, and where is there doc for it?

I'll do that (probably by going directly to the gcc mailing list). But this should not, IMHO, delay the fixing of this blocker bug.

Done [ https://gcc.gnu.org/ml/gcc/2016-11/msg00014.html here].

The answer is here : and it is shamefully simple :

"The option -r is passed to ld, so you have to look for it in ld's manual  where it is 
clearly documented."

<Sigh...>

@kiwifb
Copy link
Member

kiwifb commented Nov 7, 2016

comment:16

Yes I could tell that it was passed to ld, but normally you need -Wl, to do that. And the other options that are passed to ld like -L and -l are documented. Other compilers pass unknown options to the linker (IBM XL familly of compilers if you need an example) but this is not supposed to be case for gcc.

And best of all while it is passed to ld, how is it passed differently from when it is given by -Wl,-r and why doesn't it trigger the incompatibility problem then?

Anyone interested in seeing some gory details of flint/arb compilation can set CC="gcc -v -Wl,--verbose" (I didn't use CFLAGS because the lines with -r don't include CFLAGS).

@kiwifb
Copy link
Member

kiwifb commented Nov 7, 2016

comment:17

I asked on sage-devel but I'll ask again here, can you post the output of gcc -dumpspecs, you can send that privately if you wish. I'd like to see how they enforce the "pie" stuff. That may enlighten me.

We know empirically that the fix works. We just don't know why and that annoys me deeply.

@EmmanuelCharpentier
Copy link
Mannequin

EmmanuelCharpentier mannequin commented Nov 8, 2016

comment:18

Replying to @kiwifb:

I asked on sage-devel

Sorry : I missed that one (and can't find it, BTW...)

but I'll ask again here, can you post the output of gcc -dumpspecs,

Here it comes :

charpent@asus16-ec:~$ gcc -dumpspecs
*asm:
%{m16|m32:--32}  %{m16|m32|mx32:;:--64}  %{mx32:--x32}  %{!mno-sse2avx:%{mavx:-msse2avx}} %{msse2avx:%{!mavx:-msse2avx}}

*asm_debug:
%{!g0:%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}} %{fdebug-prefix-map=*:--debug-prefix-map %*}

*asm_final:
%{gsplit-dwarf: 
       objcopy --extract-dwo 	 %{c:%{o*:%*}%{!o*:%b%O}}%{!c:%U%O} 	 %{c:%{o*:%:replace-extension(%{o*:%*} .dwo)}%{!o*:%b.dwo}}%{!c:%b.dwo} 
       objcopy --strip-dwo 	 %{c:%{o*:%*}%{!o*:%b%O}}%{!c:%U%O}     }

*asm_options:
%{-target-help:%:print-asm-header()} %{v} %{w:-W} %{I*}  %{gz*:%e-gz is not supported in this configuration} %a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}

*invoke_as:
%{!fwpa*:   %{fcompare-debug=*|fdump-final-insns=*:%:compare-debug-dump-opt()}   %{!S:-o %|.s |
 as %(asm_options) %m.s %A }  }

*cpp:
%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}

*cpp_options:
%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w} %{f*} %{g*:%{!g0:%{g*} %{!fno-working-directory:-fworking-directory}}} %{O*} %{undef} %{save-temps*:-fpch-preprocess}

*cpp_debug_options:
%{d*}

*cpp_unique_options:
%{!Q:-quiet} %{nostdinc*} %{C} %{CC} %{v} %{I*&F*} %{P} %I %{MD:-MD %{!o:%b.d}%{o*:%.d%*}} %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}} %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*} %{!E:%{!M:%{!MM:%{!MT:%{!MQ:%{MD|MMD:%{o*:-MQ %*}}}}}}} %{remap} %{g3|ggdb3|gstabs3|gcoff3|gxcoff3|gvms3:-dD} %{!iplugindir*:%{fplugin*:%:find-plugindir()}} %{H} %C %{D*&U*&A*} %{i*} %Z %i %{E|M|MM:%W{o*}}

*trad_capable_cpp:
cc1 -E %{traditional|traditional-cpp:-traditional-cpp}

*cc1:
%{!mandroid|tno-android-cc:%(cc1_cpu) %{profile:-p};:%(cc1_cpu) %{profile:-p} %{!mglibc:%{!muclibc:%{!mbionic: -mbionic}}} %{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC: -fPIC}}}}}

*cc1_options:
%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}} %{!iplugindir*:%{fplugin*:%:find-plugindir()}} %1 %{!Q:-quiet} %{!dumpbase:-dumpbase %B} %{d*} %{m*} %{aux-info*} %{fcompare-debug-second:%:compare-debug-auxbase-opt(%b)}  %{!fcompare-debug-second:%{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}}%{!c:%{!S:-auxbase %b}}  %{g*} %{O*} %{W*&pedantic*} %{w} %{std*&ansi&trigraphs} %{v:-version} %{pg:-p} %{p} %{f*} %{undef} %{Qn:-fno-ident} %{Qy:} %{-help:--help} %{-target-help:--target-help} %{-version:--version} %{-help=*:--help=%*} %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}} %{fsyntax-only:-o %j} %{-param*} %{coverage:-fprofile-arcs -ftest-coverage}

*cc1plus:


*link_gcc_c_sequence:
%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}

*link_ssp:
%{fstack-protector|fstack-protector-all|fstack-protector-strong|fstack-protector-explicit:}

*endfile:
%{!mandroid|tno-android-ld:%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s}    %{mpc32:crtprec32.o%s}    %{mpc64:crtprec64.o%s}    %{mpc80:crtprec80.o%s} %{fvtable-verify=none:%s;      fvtable-verify=preinit:vtv_end_preinit.o%s;      fvtable-verify=std:vtv_end.o%s}    %{shared:crtendS.o%s;: %{no-pie|static|r|shared:;:crtendS.o%s}    %{no-pie|static:crtend.o%s}} crtn.o%s    ;:%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s}    %{mpc32:crtprec32.o%s}    %{mpc64:crtprec64.o%s}    %{mpc80:crtprec80.o%s} %{shared: crtend_so%O%s;: crtend_android%O%s}}

*link:
%{!r:--build-id} %{!static:--eh-frame-hdr} %{!mandroid|tno-android-ld:%{m16|m32|mx32:;:-m elf_x86_64}                    %{m16|m32:-m elf_i386}                    %{mx32:-m elf32_x86_64}   --hash-style=gnu   %{shared:-shared}   %{!shared:     %{!static:       %{rdynamic:-export-dynamic}       %{m16|m32:-dynamic-linker %{muclibc:/lib/ld-uClibc.so.0;:%{mbionic:/system/bin/linker;:%{mmusl:/lib/ld-musl-i386.so.1;:/lib/ld-linux.so.2}}}}       %{m16|m32|mx32:;:-dynamic-linker %{muclibc:/lib/ld64-uClibc.so.0;:%{mbionic:/system/bin/linker64;:%{mmusl:/lib/ld-musl-x86_64.so.1;:/lib64/ld-linux-x86-64.so.2}}}}       %{mx32:-dynamic-linker %{muclibc:/lib/ldx32-uClibc.so.0;:%{mbionic:/system/bin/linkerx32;:%{mmusl:/lib/ld-musl-x32.so.1;:/libx32/ld-linux-x32.so.2}}}}}     %{static:-static}};:%{m16|m32|mx32:;:-m elf_x86_64}                    %{m16|m32:-m elf_i386}                    %{mx32:-m elf32_x86_64}   --hash-style=gnu   %{shared:-shared}   %{!shared:     %{!static:       %{rdynamic:-export-dynamic}       %{m16|m32:-dynamic-linker %{muclibc:/lib/ld-uClibc.so.0;:%{mbionic:/system/bin/linker;:%{mmusl:/lib/ld-musl-i386.so.1;:/lib/ld-linux.so.2}}}}       %{m16|m32|mx32:;:-dynamic-linker %{muclibc:/lib/ld64-uClibc.so.0;:%{mbionic:/system/bin/linker64;:%{mmusl:/lib/ld-musl-x86_64.so.1;:/lib64/ld-linux-x86-64.so.2}}}}       %{mx32:-dynamic-linker %{muclibc:/lib/ldx32-uClibc.so.0;:%{mbionic:/system/bin/linkerx32;:%{mmusl:/lib/ld-musl-x32.so.1;:/libx32/ld-linux-x32.so.2}}}}}     %{static:-static}} %{shared: -Bsymbolic}}

*lib:
%{!mandroid|tno-android-ld:%{pthread:-lpthread} %{shared:-lc}    %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}};:%{shared:-lc}    %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}} %{!static: -ldl}}

*link_gomp:


*libgcc:
%{static|static-libgcc:-lgcc -lgcc_eh}%{!static:%{!static-libgcc:%{!shared-libgcc:-lgcc --as-needed -lgcc_s --no-as-needed}%{shared-libgcc:-lgcc_s%{!shared: -lgcc}}}}

*startfile:
%{!mandroid|tno-android-ld:%{!shared: %{pg|p|profile:gcrt1.o%s;:     %{no-pie|static|r|shared:;:Scrt1.o%s} %{no-pie|static:crt1.o%s}}}    crti.o%s %{static:crtbeginT.o%s;: %{shared:crtbeginS.o%s} 	      %{no-pie|static|r|shared:;:crtbeginS.o%s} 	      %{no-pie|static:crtbegin.o%s}}    %{fvtable-verify=none:%s;      fvtable-verify=preinit:vtv_start_preinit.o%s;      fvtable-verify=std:vtv_start.o%s}    ;:%{shared: crtbegin_so%O%s;:  %{static: crtbegin_static%O%s;: crtbegin_dynamic%O%s}}}

*cross_compile:
0

*version:
6.2.0

*multilib:
. !m32 !m64 !mx32;32:../lib32:i386-linux-gnu m32 !m64 !mx32;64:../lib:x86_64-linux-gnu !m32 m64 !mx32;x32:../libx32:x86_64-linux-gnux32 !m32 !m64 mx32;

*multilib_defaults:
m64

*multilib_extra:


*multilib_matches:
m32 m32;m64 m64;mx32 mx32;

*multilib_exclusions:


*multilib_options:
m32/m64/mx32

*multilib_reuse:


*linker:
collect2

*linker_plugin_file:


*lto_wrapper:


*lto_gcc:


*post_link:


*link_libgcc:
%D

*md_exec_prefix:


*md_startfile_prefix:


*md_startfile_prefix_1:


*startfile_prefix_spec:


*sysroot_spec:
--sysroot=%R

*sysroot_suffix_spec:


*sysroot_hdrs_suffix_spec:


*self_spec:


*cc1_cpu:
%{march=native:%>march=native %:local_cpu_detect(arch)   %{!mtune=*:%>mtune=native %:local_cpu_detect(tune)}} %{mtune=native:%>mtune=native %:local_cpu_detect(tune)}

*link_command:
%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:    %(linker) %{!fno-use-linker-plugin:%{!fno-lto:     -plugin %(linker_plugin_file)     -plugin-opt=%(lto_wrapper)     -plugin-opt=-fresolution=%u.res     %{!nostdlib:%{!nodefaultlibs:%:pass-through-libs(%(link_gcc_c_sequence))}}     }}%{flto|flto=*:%<fcompare-debug*}     %{flto} %{fno-lto} %{flto=*} %l %{no-pie:} %{no-pie|static|r|shared:;:-pie} %{fuse-ld=*:-fuse-ld=%*}  %{gz*:%e-gz is not supported in this configuration} %X %{o*} %{e*} %{N} %{n} %{r}    %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}}     %{static:} %{L*} %(mfwrap) %(link_libgcc) %{!nostdlib:%{fvtable-verify=std: -lvtv -u_vtable_map_vars_start -u_vtable_map_vars_end}    %{fvtable-verify=preinit: -lvtv -u_vtable_map_vars_start -u_vtable_map_vars_end}} %{!nostdlib:%{!nodefaultlibs:%{%:sanitize(address):%{!shared:libasan_preinit%O%s} %{static-libasan:%{!shared:-Bstatic --whole-archive -lasan --no-whole-archive -Bdynamic}}%{!static-libasan:-lasan}}     %{%:sanitize(thread):%{static-libtsan:%{!shared:-Bstatic --whole-archive -ltsan --no-whole-archive -Bdynamic}}%{!static-libtsan:-ltsan}}     %{%:sanitize(leak):%{static-liblsan:%{!shared:-Bstatic --whole-archive -llsan --no-whole-archive -Bdynamic}}%{!static-liblsan:-llsan}}}} %o %{!nostdlib:%{!nodefaultlibs:%{mmpx:%{fcheck-pointer-bounds:    %{static:--whole-archive -lmpx --no-whole-archive %:include(libmpx.spec)%(link_libmpx)}    %{!static:%{static-libmpx:-Bstatic --whole-archive}    -lmpx %{static-libmpx:--no-whole-archive -Bdynamic %:include(libmpx.spec)%(link_libmpx)}}}}%{mmpx:%{fcheck-pointer-bounds:%{!fno-chkp-use-wrappers:    %{static:-lmpxwrappers}    %{!static:%{static-libmpxwrappers:-Bstatic --whole-archive}    -lmpxwrappers %{static-libmpxwrappers:--no-whole-archive -Bdynamic}}}}}}} %{mmpx:%{fcheck-pointer-bounds:%{!static:%{m16|m32|mx32:;:-z bndplt }}}}     %{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):	%:include(libgomp.spec)%(link_gomp)}    %{fcilkplus:%:include(libcilkrts.spec)%(link_cilkrts)}    %{fgnu-tm:%:include(libitm.spec)%(link_itm)}    %(mflib)  %{fsplit-stack: --wrap=pthread_create}    %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} %{!nostdlib:%{!nodefaultlibs:%{%:sanitize(address): %{static-libasan:%:include(libsanitizer.spec)%(link_libasan)}    %{static:%ecannot specify -static with -fsanitize=address}}    %{%:sanitize(thread): %{static-libtsan:%:include(libsanitizer.spec)%(link_libtsan)}    %{static:%ecannot specify -static with -fsanitize=thread}}    %{%:sanitize(undefined):%{static-libubsan:-Bstatic} -lubsan %{static-libubsan:-Bdynamic} %{static-libubsan:%:include(libsanitizer.spec)%(link_libubsan)}}    %{%:sanitize(leak): %{static-liblsan:%:include(libsanitizer.spec)%(link_liblsan)}}}}     %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}    %{!nostdlib:%{!nostartfiles:%E}} %{T*}  
%(post_link) }}}}}}

you can send that privately if you wish. I'd like to see how they enforce the "pie" stuff. That may enlighten me.

We know empirically that the fix works. We just don't know why and that annoys me deeply.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 8, 2016

Changed commit from 1833b35 to 96442c6

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 8, 2016

Branch pushed to git repo; I updated commit sha1. New commits:

96442c6Original author's name received.

@EmmanuelCharpentier
Copy link
Mannequin

EmmanuelCharpentier mannequin commented Nov 8, 2016

Changed author from Jörg-Volker, Emmanuel Charpentier to Jörg-Volker Peetz, Emmanuel Charpentier

@EmmanuelCharpentier
Copy link
Mannequin

EmmanuelCharpentier mannequin commented Nov 8, 2016

comment:20

Original author's name added.

@kiwifb
Copy link
Member

kiwifb commented Nov 8, 2016

comment:21

Needs to go to the bots to figure out if it breaks something on other distro/compilers. But otherwise look in shape.

@kiwifb
Copy link
Member

kiwifb commented Nov 8, 2016

Reviewer: Jeroen Demeyer, François Bissey

@vbraun
Copy link
Member

vbraun commented Nov 9, 2016

Changed branch from u/charpent/fix-flint to 96442c6

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

No branches or pull requests

4 participants