[Bug ld/26766] Support standalone PGO build

2021-02-28 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=26766

--- Comment #26 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by H.J. Lu :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1dbde357be3ce2641595b10436822e699abe32a0

commit 1dbde357be3ce2641595b10436822e699abe32a0
Author: H.J. Lu 
Date:   Sun Feb 28 04:39:38 2021 -0800

Add missing changes to Makefile.tpl

Update Makefile.tpl to add missing changes in

commit af019bfde9b13d628202fe58054ec7ff08d92a0f
Author: H.J. Lu 
Date:   Sat Jan 9 06:51:15 2021 -0800

Support the PGO build for binutils+gdb

"autogen Makefile.def" showed no changes in Makefile.in.

PR binutils/26766
* Makefile.tpl (PGO_BUILD_TRAINING_FLAGS_TO_PASS): Add
PGO_BUILD_TRAINING=yes.
(PGO_BUILD_TRAINING_MFLAGS): New.
(all): Pass $(PGO_BUILD_TRAINING_MFLAGS) to the PGO build.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26766] Support standalone PGO build

2021-01-11 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26766

H.J. Lu  changed:

   What|Removed |Added

   Target Milestone|--- |2.37
 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #25 from H.J. Lu  ---
Fixed for 2.37.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26766] Support standalone PGO build

2021-01-11 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=26766

--- Comment #24 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by H.J. Lu :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=44124a46839b3563e448edfd013c6faa6a8b1642

commit 44124a46839b3563e448edfd013c6faa6a8b1642
Author: H.J. Lu 
Date:   Mon Jan 11 16:37:03 2021 -0800

binuitils: Check if AR is usable for LTO build

Check if AR is usable for LTO build with --enable-pgo-build=lto:

checking for -plugin option... ar: no operation specified
Failed: ar --plugin
/usr/gcc-11.0.0-x32/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/liblto_plugin.so rc
no
configure: error: AR with --plugin and rc is required for LTO build

instead of build failure later.

PR binutils/26766
* configure.ac:
* configure: Regenerated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26766] Support standalone PGO build

2021-01-11 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26766

--- Comment #23 from H.J. Lu  ---
(In reply to Martin Liska from comment #22)
> Kudos H.J.
> Can we close this as resolved?

--enable-pgo-build=lto fails with binutils 2.30 since ar in binutils 2.30
doesn't support

$ ar --plugin /usr/libexec/gcc/x86_64-redhat-linux/10/liblto_plugin.so rc 

Do we need to detect it and issue an error at configure time?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26766] Support standalone PGO build

2021-01-11 Thread mliska at suse dot cz
https://sourceware.org/bugzilla/show_bug.cgi?id=26766

--- Comment #22 from Martin Liska  ---
Kudos H.J.
Can we close this as resolved?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26766] Support standalone PGO build

2021-01-09 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=26766

--- Comment #21 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by H.J. Lu :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=af019bfde9b13d628202fe58054ec7ff08d92a0f

commit af019bfde9b13d628202fe58054ec7ff08d92a0f
Author: H.J. Lu 
Date:   Sat Jan 9 06:51:15 2021 -0800

Support the PGO build for binutils+gdb

Add the --enable-pgo-build[=lto] configure option.  When binutils+gdb
is not built together with GCC, --enable-pgo-build enables the PGO build:

1. First build with -fprofile-generate.
2. Use "make maybe-check-*" to generate profiling data and pass -i to make
to ignore errors when generating profiling data.
3. Use "make clean" to remove the previous build.
4. Rebuild with -fprofile-use.

With --enable-pgo-build=lto, -flto=jobserver -ffat-lto-objects are used
together with -fprofile-generate and -fprofile-use.  Add '+' to the command
line for recursive make to support -flto=jobserver -ffat-lto-objects.

NB: --enable-pgo-build=lto enables the PGO build with LTO while
--enable-lto enables LTO support in toolchain.

PR binutils/26766
* Makefile.tpl (BUILD_CFLAGS): New.
(CFLAGS): Append $(BUILD_CFLAGS).
(CXXFLAGS): Likewise.
(PGO_BUILD_GEN_FLAGS_TO_PASS): New.
(PGO_BUILD_TRAINING_CFLAGS): Likewise.
(PGO_BUILD_TRAINING_CXXFLAGS): Likewise.
(PGO_BUILD_TRAINING_FLAGS_TO_PASS): Likewise.
(PGO_BUILD_TRAINING_MFLAGS): Likewise.
(PGO_BUILD_USE_FLAGS_TO_PASS): Likewise.
(PGO-TRAINING-TARGETS): Likewise.
(PGO_BUILD_TRAINING): Likewise.
(all): Add '+' to the command line for recursive make.  Support
the PGO build.
* configure.ac: Add --enable-pgo-build[=lto].
AC_SUBST PGO_BUILD_GEN_CFLAGS, PGO_BUILD_USE_CFLAGS and
PGO_BUILD_LTO_CFLAGS.  Enable the PGO build in Makefile.
* Makefile.in: Regenerated.
* configure: Likewise.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26766] Support standalone PGO build

2020-11-16 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26766

--- Comment #20 from H.J. Lu  ---
(In reply to Martin Liska from comment #19)
> H.J. What's the status of the patch set, please?

I got no feedbacks.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26766] Support standalone PGO build

2020-11-16 Thread mliska at suse dot cz
https://sourceware.org/bugzilla/show_bug.cgi?id=26766

--- Comment #19 from Martin Liska  ---
H.J. What's the status of the patch set, please?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26766] Support standalone PGO build

2020-10-26 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26766

--- Comment #18 from H.J. Lu  ---
I opened:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97586

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26766] Support standalone PGO build

2020-10-26 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26766

--- Comment #17 from H.J. Lu  ---
With GCC 11

commit 4f8cfb42883cc247f11096a3703e379d1f24ab3f
Author: Jan Hubicka 
Date:   Mon Oct 26 20:19:33 2020 +0100

Extend builtin fnspecs

I got 

FAIL: nm --line-numbers on DWARF-4 debug info (grep for externd global
file/line)
FAIL: build-id-debuglink (grepping for source file name in disassembly output)
FAIL: objdump -S
FAIL: objdump --source-comment
FAIL: DWARF parse during linker error
FAIL: Build warn libbar.so
FAIL: Run warn with versioned libfoo.so
FAIL: undefined symbol with compressed debug sections
FAIL: PR ld/12760
FAIL: plugin claimfile lost symbol
FAIL: plugin claimfile replace symbol
FAIL: plugin claimfile resolve symbol
FAIL: plugin claimfile lost symbol with source
FAIL: plugin claimfile replace symbol with source
FAIL: plugin claimfile resolve symbol with source
FAIL: plugin 2 with source lib
FAIL: load plugin 2 with source
FAIL: plugin 3 with source lib
FAIL: load plugin 3 with source
FAIL: undefined line
FAIL: undefined line
FAIL: undefined symbol with compressed debug sections

with

--enable-pgo-build=lto --disable-werror

It looks binutils is miscompiled by GCC 11.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26766] Support standalone PGO build

2020-10-26 Thread mliska at suse dot cz
https://sourceware.org/bugzilla/show_bug.cgi?id=26766

--- Comment #16 from Martin Liska  ---
You need GCC 11 in order to see the lto-wrapper warning.
Btw. I'm using:
make --version
GNU Make 4.3

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26766] Support standalone PGO build

2020-10-26 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26766

--- Comment #15 from H.J. Lu  ---
(In reply to H.J. Lu from comment #13)
> (In reply to Martin Liska from comment #12)
> 
> > 
> > I can fix it with the following change:
> > 
> > diff -u gas/Makefile.orig gas/Makefile
> > --- gas/Makefile.orig   2020-10-26 18:41:45.992955514 +0100
> > +++ gas/Makefile2020-10-26 18:42:21.976647698 +0100
> > @@ -1081,8 +1081,8 @@
> > config/$(DEPDIR)/$(am__dirstamp)
> >  
> >  as-new$(EXEEXT): $(as_new_OBJECTS) $(as_new_DEPENDENCIES)
> > $(EXTRA_as_new_DEPENDENCIES) 
> > -   @rm -f as-new$(EXEEXT)
> > -   $(AM_V_CCLD)$(LINK) $(as_new_OBJECTS) $(as_new_LDADD) $(LIBS)
> > +   + @rm -f as-new$(EXEEXT)
> > +   + $(AM_V_CCLD)$(LINK) $(as_new_OBJECTS) $(as_new_LDADD) $(LIBS)
> >  
> >  itbl-test$(EXEEXT): $(itbl_test_OBJECTS) $(itbl_test_DEPENDENCIES)
> > $(EXTRA_itbl_test_DEPENDENCIES) 
> > @rm -f itbl-test$(EXEEXT)
> > 
> > but I don't know how to modify the original gas/Makefile.am
> > ?
> 
> I will fix it.

It works for me with GNU make 4.2.1:

/bin/sh ./libtool  --tag=CC   --mode=link cc -W -Wall -Wstrict-prototypes
-Wmissing-prototypes -Wshadow -Wstack-usage=262144 -Wwrite-strings  -O2 -g  
-fcf-protection-fprofile-generate -flto=jobserver   -o as-new app.o as.o
atof-generic.o compress-debug.o cond.o depend.o dwarf2dbg.o dw2gencfi.o ecoff.o
ehopt.o expr.o flonum-copy.o flonum-konst.o flonum-mult.o frags.o hash.o
input-file.o input-scrub.o listing.o literal.o macro.o messages.o output-file.o
read.o remap.o sb.o stabs.o subsegs.o symbols.o write.o config/tc-i386.o
config/obj-elf.o config/atof-ieee.o  ../opcodes/libopcodes.la ../bfd/libbfd.la
../libiberty/libiberty.a   -ldl
libtool: link: cc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow
-Wstack-usage=262144 -Wwrite-strings -O2 -g -fcf-protection -fprofile-generate
-flto=jobserver -o as-new app.o as.o atof-generic.o compress-debug.o cond.o
depend.o dwarf2dbg.o dw2gencfi.o ecoff.o ehopt.o expr.o flonum-copy.o
flonum-konst.o flonum-mult.o frags.o hash.o input-file.o input-scrub.o
listing.o literal.o macro.o messages.o output-file.o read.o remap.o sb.o
stabs.o subsegs.o symbols.o write.o config/tc-i386.o config/obj-elf.o
config/atof-ieee.o  ../opcodes/.libs/libopcodes.a ../bfd/.libs/libbfd.a -lz
../libiberty/libiberty.a -ldl
/export/gnu/import/git/gitlab/x86-binutils/libiberty/make-relative-prefix.c: In
function 'make_relative_prefix_1.constprop':
/export/gnu/import/git/gitlab/x86-binutils/libiberty/make-relative-prefix.c:230:1:
warning: stack usage might be unbounded [-Wstack-usage=]
  230 | make_relative_prefix_1 (const char *progname, const char *bin_prefix,
  | ^
make[6]: Leaving directory
'/export/build/gnu/tools-build/binutils-pgo/build-x86_64-linux/gas'

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26766] Support standalone PGO build

2020-10-26 Thread mliska at suse dot cz
https://sourceware.org/bugzilla/show_bug.cgi?id=26766

--- Comment #14 from Martin Liska  ---
And can you also please take a look at:
https://sourceware.org/bugzilla/show_bug.cgi?id=26777

It's blocking the PGO build for me with the latest GCC master.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26766] Support standalone PGO build

2020-10-26 Thread mliska at suse dot cz
https://sourceware.org/bugzilla/show_bug.cgi?id=26766

--- Comment #12 from Martin Liska  ---
> I pass -flto=jobserver to the PGO build.  The separate --enable-lto-build
> isn't very useful.  You can build binutils with LTO by passing -flto to
> CFLAGS. I will rename --enable-pgo-bootstrap=lto to --enable-pgo-build=lto
> since the newly built binutils is used only for PGO training.

All right, as mentioned, it works for me.

About the jobserver support, when using GCC 11, one can see the following
warning when a sub-make is not run with '+' rule:

libtool: link: gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow
-Wstack-usage=262144 -Wwrite-strings -I../../gas/../zlib -g -O2
-fprofile-generate -flto=jobserver -o as-new app.o as.o atof-generic.o
compress-debug.o cond.o depend.o dwarf2dbg.o dw2gencfi.o ecoff.o ehopt.o expr.o
flonum-copy.o flonum-konst.o flonum-mult.o frags.o hash.o input-file.o
input-scrub.o listing.o literal.o macro.o messages.o output-file.o read.o
remap.o sb.o stabs.o subsegs.o symbols.o write.o config/tc-i386.o
config/obj-elf.o config/atof-ieee.o  ../opcodes/.libs/libopcodes.a
../bfd/.libs/libbfd.a -L/tmp/binutils-gdb/objdir/zlib -lz
../libiberty/libiberty.a -ldl
lto-wrapper: warning: jobserver is not available: '--jobserver-auth=' is not
present in 'MAKEFLAGS'

I can fix it with the following change:

diff -u gas/Makefile.orig gas/Makefile
--- gas/Makefile.orig   2020-10-26 18:41:45.992955514 +0100
+++ gas/Makefile2020-10-26 18:42:21.976647698 +0100
@@ -1081,8 +1081,8 @@
config/$(DEPDIR)/$(am__dirstamp)

 as-new$(EXEEXT): $(as_new_OBJECTS) $(as_new_DEPENDENCIES)
$(EXTRA_as_new_DEPENDENCIES) 
-   @rm -f as-new$(EXEEXT)
-   $(AM_V_CCLD)$(LINK) $(as_new_OBJECTS) $(as_new_LDADD) $(LIBS)
+   + @rm -f as-new$(EXEEXT)
+   + $(AM_V_CCLD)$(LINK) $(as_new_OBJECTS) $(as_new_LDADD) $(LIBS)

 itbl-test$(EXEEXT): $(itbl_test_OBJECTS) $(itbl_test_DEPENDENCIES)
$(EXTRA_itbl_test_DEPENDENCIES) 
@rm -f itbl-test$(EXEEXT)

but I don't know how to modify the original gas/Makefile.am
?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26766] Support standalone PGO build

2020-10-26 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26766

--- Comment #13 from H.J. Lu  ---
(In reply to Martin Liska from comment #12)

> 
> I can fix it with the following change:
> 
> diff -u gas/Makefile.orig gas/Makefile
> --- gas/Makefile.orig 2020-10-26 18:41:45.992955514 +0100
> +++ gas/Makefile  2020-10-26 18:42:21.976647698 +0100
> @@ -1081,8 +1081,8 @@
>   config/$(DEPDIR)/$(am__dirstamp)
>  
>  as-new$(EXEEXT): $(as_new_OBJECTS) $(as_new_DEPENDENCIES)
> $(EXTRA_as_new_DEPENDENCIES) 
> - @rm -f as-new$(EXEEXT)
> - $(AM_V_CCLD)$(LINK) $(as_new_OBJECTS) $(as_new_LDADD) $(LIBS)
> + + @rm -f as-new$(EXEEXT)
> + + $(AM_V_CCLD)$(LINK) $(as_new_OBJECTS) $(as_new_LDADD) $(LIBS)
>  
>  itbl-test$(EXEEXT): $(itbl_test_OBJECTS) $(itbl_test_DEPENDENCIES)
> $(EXTRA_itbl_test_DEPENDENCIES) 
>   @rm -f itbl-test$(EXEEXT)
> 
> but I don't know how to modify the original gas/Makefile.am
> ?

I will fix it.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26766] Support standalone PGO build

2020-10-26 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26766

--- Comment #11 from H.J. Lu  ---
(In reply to Martin Liska from comment #10)

> - about the --enable-pgo-bootstrap=lto, I would recommend adding an
> orthogonal option: --enable-lto-build where it will append -flto=jobserver
> and will be independent to --enable-pgo-bootstrap as I asked in the original
> comment.
> 

I pass -flto=jobserver to the PGO build.  The separate --enable-lto-build
isn't very useful.  You can build binutils with LTO by passing -flto to
CFLAGS. I will rename --enable-pgo-bootstrap=lto to --enable-pgo-build=lto
since the newly built binutils is used only for PGO training.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26766] Support standalone PGO build

2020-10-26 Thread mliska at suse dot cz
https://sourceware.org/bugzilla/show_bug.cgi?id=26766

--- Comment #10 from Martin Liska  ---
(In reply to H.J. Lu from comment #9)
> I updated users/hjl/pgo-lto branch.  Please give it a try.

Looks nice to me!

Few comments:
- using make -j16 leads to invocation of many ltrans units:

$ ps ax | grep lto1 | grep ltrans | wc -l
182

16057 pts/4R+ 0:00 /usr/lib64/gcc/x86_64-suse-linux/10/lto1 -quiet
-dumpdir ./ -dumpbase size.ltrans20 -mtune=generic -march=x86-64 -auxbase-strip
/tmp/size.LZeDmU.ltrans20.ltrans.o -g -g -O2 -O2 -Wextra -Wshadow
-Wstack-usage=262144 -fno-openmp -fno-openacc -fno-pie -fprofile-generate
-fltrans /tmp/size.LZeDmU.ltrans20.o -o /tmp/cctrJGxZ.s
16059 pts/4R+ 0:00 /usr/lib64/gcc/x86_64-suse-linux/10/lto1 -quiet
-dumpdir ./ -dumpbase strings.ltrans1 -mtune=generic -march=x86-64
-auxbase-strip /tmp/strings.hZ0ByX.ltrans1.ltrans.o -g -g -O2 -O2 -Wextra
-Wshadow -Wstack-usage=262144 -fno-openmp -fno-openacc -fno-pie
-fprofile-generate -fltrans /tmp/strings.hZ0ByX.ltrans1.o -o /tmp/ccRyZY47.s
16061 pts/4R+ 0:00 /usr/lib64/gcc/x86_64-suse-linux/10/lto1 -quiet
-dumpdir ./ -dumpbase size.ltrans15 -mtune=generic -march=x86-64 -auxbase-strip
/tmp/size.LZeDmU.ltrans15.ltrans.o -g -g -O2 -O2 -Wextra -Wshadow
-Wstack-usage=262144 -fno-openmp -fno-openacc -fno-pie -fprofile-generate
-fltrans /tmp/size.LZeDmU.ltrans15.o -o /tmp/cctzjdSi.s
16063 pts/4R+ 0:00 /usr/lib64/gcc/x86_64-suse-linux/10/lto1 -quiet
-dumpdir ./ -dumpbase strings.ltrans6 -mtune=generic -march=x86-64
-auxbase-strip /tmp/strings.hZ0ByX.ltrans6.ltrans.o -g -g -O2 -O2 -Wextra
-Wshadow -Wstack-usage=262144 -fno-openmp -fno-openacc -fno-pie
-fprofile-generate -fltrans /tmp/strings.hZ0ByX.ltrans6.o -o /tmp/ccbMqdFo.s

It seems -flto=jobserver is not working as it should be.

- about the --enable-pgo-bootstrap=lto, I would recommend adding an orthogonal
option: --enable-lto-build where it will append -flto=jobserver and will be
independent to --enable-pgo-bootstrap as I asked in the original comment.

Apart from that, it works nice!

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26766] Support standalone PGO build

2020-10-23 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26766

--- Comment #9 from H.J. Lu  ---
I updated users/hjl/pgo-lto branch.  Please give it a try.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26766] Support standalone PGO build

2020-10-23 Thread mliska at suse dot cz
https://sourceware.org/bugzilla/show_bug.cgi?id=26766

--- Comment #7 from Martin Liska  ---
> The way I implement it works better with --enable-pgo-bootstrap=lto since
> -flto is passed together with PGO options.  --enable-lto can't work without
> --enable-pgo-bootstrap.
> 

Can you please explain to me why it can't work?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26766] Support standalone PGO build

2020-10-23 Thread mliska at suse dot cz
https://sourceware.org/bugzilla/show_bug.cgi?id=26766

--- Comment #6 from Martin Liska  ---
Created attachment 12919
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12919=edit
binutils LCOV

I'm attaching lcov coverage report for illustration of how much code is covered
by the tests.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26766] Support standalone PGO build

2020-10-23 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26766

--- Comment #5 from H.J. Lu  ---
(In reply to Martin Liska from comment #4)
> > Please take a look at users/hjl/pgo-lto branch
> > 
> > https://gitlab.com/x86-binutils/binutils-gdb/-/commits/users/hjl/pgo-lto
> > 
> > If check-binutils check-gas check-ld training is good enough, I can drop
> > "make install" and "make check" steps.
> 
> That's very promising!
> I have a couple of comments:
> 
> 1) I would separate --enable-standalone-pgo-binutils=lto into 2
> configuration options: --enable-lto and --enable-pgo-bootstrap
>

The way I implement it works better with --enable-pgo-bootstrap=lto since
-flto is passed together with PGO options.  --enable-lto can't work without
--enable-pgo-bootstrap.

> 2) --enable-lto should add -flto=jobserver instead of -flto, but I noticed
> the following warning when doing that:
> 
> lto-wrapper: warning: jobserver is not available: '--jobserver-auth=' is not
> present in 'MAKEFLAGS'
> 
> That's likely cased by missing '+' as documented:
> You must prepend a ‘+’ to the command recipe in the parent Makefile for this
> to work.
> 
> Can you please check it?

I will give it a try.

> 3) I would use only -fprofile-generate without an additional folder
> location; or do you see a .gcda file name clashing?

I will give it a try.

> 4) I can confirm that gas is trained well; I'm testing that for a Firefox
> LTRANS file (~100MB in size).
> 
> Anyway, great progress you made.

Good to know.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26766] Support standalone PGO build

2020-10-23 Thread mliska at suse dot cz
https://sourceware.org/bugzilla/show_bug.cgi?id=26766

--- Comment #4 from Martin Liska  ---
> Please take a look at users/hjl/pgo-lto branch
> 
> https://gitlab.com/x86-binutils/binutils-gdb/-/commits/users/hjl/pgo-lto
> 
> If check-binutils check-gas check-ld training is good enough, I can drop
> "make install" and "make check" steps.

That's very promising!
I have a couple of comments:

1) I would separate --enable-standalone-pgo-binutils=lto into 2 configuration
options: --enable-lto and --enable-pgo-bootstrap

2) --enable-lto should add -flto=jobserver instead of -flto, but I noticed the
following warning when doing that:

lto-wrapper: warning: jobserver is not available: '--jobserver-auth=' is not
present in 'MAKEFLAGS'

That's likely cased by missing '+' as documented:
You must prepend a ‘+’ to the command recipe in the parent Makefile for this to
work.

Can you please check it?

3) I would use only -fprofile-generate without an additional folder location;
or do you see a .gcda file name clashing?

4) I can confirm that gas is trained well; I'm testing that for a Firefox
LTRANS file (~100MB in size).

Anyway, great progress you made.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26766] Support standalone PGO build

2020-10-22 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26766

--- Comment #3 from H.J. Lu  ---
(In reply to Martin Liska from comment #1)
> I appreciate the effort H.J.
> 
> There are some comments:
> 
> 1) make config
> make config
> make: Nothing to be done for '../config'.
> 
> 2) I don't see what accepts the PGO-CFLAGS? I can't find it in any Makefile
> or so
> 
> 3) Why do you need the install step in between training and -fprofile-use
> run?

Please take a look at users/hjl/pgo-lto branch

https://gitlab.com/x86-binutils/binutils-gdb/-/commits/users/hjl/pgo-lto

If check-binutils check-gas check-ld training is good enough, I can drop
"make install" and "make check" steps.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26766] Support standalone PGO build

2020-10-22 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26766

--- Comment #2 from H.J. Lu  ---
(In reply to Martin Liska from comment #1)
> I appreciate the effort H.J.
> 
> There are some comments:
> 
> 1) make config
> make config
> make: Nothing to be done for '../config'.
> 
> 2) I don't see what accepts the PGO-CFLAGS? I can't find it in any Makefile
> or so
> 
> 3) Why do you need the install step in between training and -fprofile-use
> run?

This is a POC.  I am working on the real change.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26766] Support standalone PGO build

2020-10-22 Thread mliska at suse dot cz
https://sourceware.org/bugzilla/show_bug.cgi?id=26766

Martin Liska  changed:

   What|Removed |Added

 CC||mliska at suse dot cz

--- Comment #1 from Martin Liska  ---
I appreciate the effort H.J.

There are some comments:

1) make config
make config
make: Nothing to be done for '../config'.

2) I don't see what accepts the PGO-CFLAGS? I can't find it in any Makefile or
so

3) Why do you need the install step in between training and -fprofile-use run?

-- 
You are receiving this mail because:
You are on the CC list for the bug.