Skip to content

build MPFR in GCC stage 1 without LTO if (system) GCC used is too old#1435

Merged
migueldiascosta merged 4 commits intoeasybuilders:developfrom
boegel:gcc_lto
Jun 11, 2018
Merged

build MPFR in GCC stage 1 without LTO if (system) GCC used is too old#1435
migueldiascosta merged 4 commits intoeasybuilders:developfrom
boegel:gcc_lto

Conversation

@boegel
Copy link
Copy Markdown
Member

@boegel boegel commented Jun 6, 2018

@boegel boegel added the bug fix label Jun 6, 2018
@boegel boegel added this to the 3.6.2 milestone Jun 6, 2018
@boegel
Copy link
Copy Markdown
Member Author

boegel commented Jun 6, 2018

@migueldiascosta Please test this for building GCCcore 7.3.0 on CentOS 6.x?

vanzod
vanzod previously approved these changes Jun 6, 2018
@boegel
Copy link
Copy Markdown
Member Author

boegel commented Jun 7, 2018

@migueldiascosta testing in easybuilders/easybuild-easyconfigs#6431 shows that the current solution doesn't work...

While without this patch, the build dies in stage 1 when building MPFR:

checking if Link Time Optimisation flag '-flto' is supported...... no
configure: error: Link Time Optimisation flag '-flto' is not supported.
make[1]: *** [configure-mpfr] Error 1
make[1]: Leaving directory `/dev/shm/build/GCCcore/8.1.0/dummy-/gcc-8.1.0/stage1_obj'

it now dies in stage 3 for basically the same reason:

checking if Link Time Optimisation flag '-flto' is supported...... no
configure: error: Link Time Optimisation flag '-flto' is not supported.
make[2]: *** [configure-stage1-mpfr] Error 1
make[2]: Leaving directory `/dev/shm/build/GCCcore/8.1.0/dummy-/gcc-8.1.0/stage3_obj'

That makes sense, since we've actually built the GCC in stage 1 with --disable-lto...

The correct fix is to only build MPFR itself with --disable-lto somehow, not the whole compiler.

@boegel boegel changed the title build GCC stage 1 without LTO support if (system) GCC used is too old (WIP) build MPFR in GCC stage 1 without LTO if (system) GCC used is too old (WIP) Jun 7, 2018
@boegel
Copy link
Copy Markdown
Member Author

boegel commented Jun 7, 2018

2nd try, please test @migueldiascosta?

@easybuilders easybuilders deleted a comment from boegelbot Jun 7, 2018
Comment thread easybuild/easyblocks/g/gcc.py Outdated

def disable_lto_mpfr_old_gcc(self, objdir):
"""
# if GCC version used to build stage 1 is too old, build GCC without LTO support in stage 1
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update comment to build MPFR, instead of GCC?

@migueldiascosta
Copy link
Copy Markdown
Member

@boegel
Copy link
Copy Markdown
Member Author

boegel commented Jun 8, 2018

Also tested on CentOS 7 with GCCcore/4.9.3, GCCcore/6.4.0, GCCcore/7.3.0 and GCCcore/8.1.0, works like a charm, so good to go (once Travis approves)?

@boegel boegel requested a review from verdurin June 8, 2018 09:10
@bartoldeman
Copy link
Copy Markdown
Contributor

lgtm, happy that the suggestion worked out alright.

@boegel boegel changed the title build MPFR in GCC stage 1 without LTO if (system) GCC used is too old (WIP) build MPFR in GCC stage 1 without LTO if (system) GCC used is too old (REVIEW) Jun 8, 2018
Copy link
Copy Markdown
Member

@migueldiascosta migueldiascosta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@migueldiascosta migueldiascosta changed the title build MPFR in GCC stage 1 without LTO if (system) GCC used is too old (REVIEW) build MPFR in GCC stage 1 without LTO if (system) GCC used is too old Jun 11, 2018
@migueldiascosta migueldiascosta merged commit 8549e35 into easybuilders:develop Jun 11, 2018
@boegel boegel deleted the gcc_lto branch June 11, 2018 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants