Author Topic: Oddities with Youtube.  (Read 35636 times)

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1317
  • Karma: +26/-0
    • View Profile
Re: Oddities with Youtube.
« Reply #30 on: November 22, 2017, 07:42:14 pm »
Dave,

Well, I have firefox-45.9.0-2.oc00.i686.rpm, which is targeted at the i686.  Unluckily it is not yet ready for wide deployment for a couple of reasons...

Yup, I got that now as well, and I'm also following the updates on the FF dev email list.

...About architectures, or at least my understanding. There's two parameters that can be passed to GCC to control what CPU we target.
 -march, which controls the actual instruction set. Targeting the Pentium 4 gives various extra instructions over the i686 such as MMX, SSE and SSE2 and perhaps others. Should benefit all modern CPU's but will sigill (unsupported instruction) on older CPU's
-mtune, which controls the instruction ordering. Most CPU's are fairly happy with the i686 ordering as even on your Phenom II, it should be close to optimum or at least good enough. Then there's the Pentium 4, which liked completely different ordering, ordering that are not optimum for most CPU's due to the P4 using such a different architecture. I'd guess if you look, your Firefox uses something like -mtune=pentium4.

Regarding the Pentium4 and extra instructions, is that really what you meant to say? It is the newer CPUs that introduce additional functionality (SSE2 maybe, etc?) and therefore the Pentium4 would default to a smaller sub-set of instructions, whereas the i686 would be the super-set. So my thinking is that the i686 target is the "desired" code for the newer CPUs...if not, then my thinking is reversed...LOL!

So here is the summary of build setups across the three different working FF 45.9 install I have:

1) === FF 45.9 GA official build 7z file ===
Compiler    Version    Compiler flags
gcc.exe    4.9.2    -Wall -Wempty-body -Wpointer-to-int-cast -Wsign-compare  -Wtype-limits -Wno-unused -Wcast-align -O2 -g -march=pentium4 -std=gnu99  -fgnu89-inline -fno-strict-aliasing -Zomf -fno-math-errno -pthread

c++    4.9.2    -idirafter /@unixroot/usr/include/os2tk45 -Wall -Wempty-body  -Woverloaded-virtual -Wsign-compare -Wwrite-strings -Wno-invalid-offsetof  -Wcast-align -O2 -g -march=pentium4 -fno-exceptions -fno-strict-aliasing  -Zomf -fno-rtti -fno-exceptions -fno-math-errno -std=gnu++0x -pthread  -DNDEBUG -DTRIMMED -g -O2 -fomit-frame-pointer -idirafter  /@unixroot/usr/include/os2tk45


2) === FF 45.9 last daily build ===
Compiler    Version    Compiler flags
gcc.exe    4.9.2    -Wall -Wempty-body -Wpointer-to-int-cast -Wsign-compare  -Wtype-limits -Wno-unused -Wcast-align -march=i686 -mtune=i686 -std=gnu99  -fgnu89-inline -fno-strict-aliasing -Zomf -fno-math-errno -pthread

c++    4.9.2    -idirafter /@unixroot/usr/include/os2tk45 -Wall -Wempty-body  -Woverloaded-virtual -Wsign-compare -Wwrite-strings -Wno-invalid-offsetof  -Wcast-align -march=i686 -mtune=i686 -fno-exceptions -fno-strict-aliasing  -Zomf -fno-rtti -fno-exceptions -fno-math-errno -std=gnu++0x -pthread  -DNDEBUG -DTRIMMED -g -O3 -fomit-frame-pointer


3) === FF 45.9 RPM EXP build ===
Compiler    Version    Compiler flags
gcc.exe    4.9.2    -Wall -Wempty-body -Wpointer-to-int-cast -Wsign-compare -Wtype-limits -Wno-unused -Wcast-align -O2 -g -march=i686 -std=gnu99 -fgnu89-inline -fno-strict-aliasing -Zomf -fno-math-errno -pthread

c++    4.9.2    -idirafter /@unixroot/usr/include/os2tk45 -Wall -Wempty-body -Woverloaded-virtual -Wsign-compare -Wwrite-strings -Wno-invalid-offsetof -Wcast-align -O2 -g -march=i686 -fno-exceptions -fno-strict-aliasing -Zomf -fno-rtti -fno-exceptions -fno-math-errno -std=gnu++0x -pthread -DNDEBUG -DTRIMMED -g -O2 -fomit-frame-pointer -idirafter /@unixroot/usr/include/os2tk45

Regarding the -mtune option, only the last 45.9 test build shows the -mtune=i686 config, the other two, the GA 7z and RPM releases do not show the matching Pentium4 nor i686 flags.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: Oddities with Youtube.
« Reply #31 on: November 22, 2017, 08:58:47 pm »
Dave,
...About architectures, or at least my understanding. There's two parameters that can be passed to GCC to control what CPU we target.
 -march, which controls the actual instruction set. Targeting the Pentium 4 gives various extra instructions over the i686 such as MMX, SSE and SSE2 and perhaps others. Should benefit all modern CPU's but will sigill (unsupported instruction) on older CPU's
-mtune, which controls the instruction ordering. Most CPU's are fairly happy with the i686 ordering as even on your Phenom II, it should be close to optimum or at least good enough. Then there's the Pentium 4, which liked completely different ordering, ordering that are not optimum for most CPU's due to the P4 using such a different architecture. I'd guess if you look, your Firefox uses something like -mtune=pentium4.

Regarding the Pentium4 and extra instructions, is that really what you meant to say? It is the newer CPUs that introduce additional functionality (SSE2 maybe, etc?) and therefore the Pentium4 would default to a smaller sub-set of instructions, whereas the i686 would be the super-set. So my thinking is that the i686 target is the "desired" code for the newer CPUs...if not, then my thinking is reversed...LOL!

Yes, that is what I meant to say. The i686 is the Pentium Pro, which is older then the Pentium 4 and didn't even have MMX instructions.

Quote
Regarding the -mtune option, only the last 45.9 test build shows the -mtune=i686 config, the other two, the GA 7z and RPM releases do not show the matching Pentium4 nor i686 flags.

That's weird. In some ways tuning for at least an i686 is more important then the CPU instructions.  If nothing else, it has become important to align the instructions on 4 (8?) byte boundaries due to the way all CPU's since the original Pentium access memory.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: Oddities with Youtube.
« Reply #32 on: November 22, 2017, 09:10:38 pm »
The SeaMonkey I'm using. Note that I targeted the Pentium M. I might upload this for experimental purposes.

gcc.exe    4.9.2    -Wall -Wempty-body -Wpointer-to-int-cast -Wsign-compare -Wtype-limits -Wno-unused -Wcast-align -Zomf -std=gnu99 -fgnu89-inline -fno-strict-aliasing -Zomf -fno-math-errno -pthread
c++    4.9.2    -idirafter g:/OS2TK45/h -Wall -Wempty-body -Woverloaded-virtual -Wsign-compare -Wwrite-strings -Wno-invalid-offsetof -Wcast-align -fno-exceptions -fno-strict-aliasing -Zomf -fno-rtti -fno-exceptions -fno-math-errno -std=gnu++0x -pthread -DNDEBUG -DTRIMMED -g -mtune=generic -march=pentium-m -Os -mstackrealign -fomit-frame-pointer

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1317
  • Karma: +26/-0
    • View Profile
Re: Oddities with Youtube.
« Reply #33 on: November 23, 2017, 04:42:16 pm »
...Regarding the Pentium4 and extra instructions, is that really what you meant to say? It is the newer CPUs that introduce additional functionality (SSE2 maybe, etc?) and therefore the Pentium4 would default to a smaller sub-set of instructions, whereas the i686 would be the super-set. So my thinking is that the i686 target is the "desired" code for the newer CPUs...if not, then my thinking is reversed...LOL!

Yes, that is what I meant to say. The i686 is the Pentium Pro, which is older then the Pentium 4 and didn't even have MMX instructions.

OK, thank you...it's slowly starting to make sense here...LOL!

I dug into this a tad more, found some good references on-line, for those who might be interested here are a few good links that put the '-march' & '-mtune' flag into perspective:

1) GCC x86 Options https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html

2) Intel 386 and AMD x86-64 Options  https://gcc.gnu.org/onlinedocs/gcc-3.1/gcc/i386-and-x86-64-Options.html

3) Safe CFLAGS https://wiki.gentoo.org/wiki/Safe_CFLAGS

4) GCC Optimization Options https://wiki.gentoo.org/wiki/GCC_optimization

I would love to try to assess the differences in the code produced by the following options:

1) -march=i686 (support for base x86 instruction set)
2) -march=pentium4 (support for MMX, SSE and SSE2 instruction set)
3) -march=amdfam10 (support for MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit instruction set)

...all other flags being the same, so let's say -O2, -pipe, etc, specifically because option #3 is supposed to produce code optimized for my AMD Phenom II X6 cpu, and on our platform, every bit of performance helps.

...That's weird. In some ways tuning for at least an i686 is more important then the CPU instructions.  If nothing else, it has become important to align the instructions on 4 (8?) byte boundaries due to the way all CPU's since the original Pentium access memory.

Maybe we are relying on the default optimizations then? Here is a quote from the GCC 4.9.4 manual:

"...Where ‘-march’ is specified without either of ‘-mtune’ or ‘-mcpu’ also being specified, the code will be tuned to perform well across a range of target processors implementing the target architecture..."

So it implies that when `-mtune' is left out we get a generic optimization across broadest possible target zone.


ak120

  • Guest
Re: Oddities with Youtube.
« Reply #34 on: November 24, 2017, 01:21:58 am »
The SeaMonkey I'm using. Note that I targeted the Pentium M. I might upload this for experimental purposes.

gcc.exe    4.9.2    -Wall -Wempty-body -Wpointer-to-int-cast -Wsign-compare -Wtype-limits -Wno-unused -Wcast-align -Zomf -std=gnu99 -fgnu89-inline -fno-strict-aliasing -Zomf -fno-math-errno -pthread
c++    4.9.2    -idirafter g:/OS2TK45/h -Wall -Wempty-body -Woverloaded-virtual -Wsign-compare -Wwrite-strings -Wno-invalid-offsetof -Wcast-align -fno-exceptions -fno-strict-aliasing -Zomf -fno-rtti -fno-exceptions -fno-math-errno -std=gnu++0x -pthread -DNDEBUG -DTRIMMED -g -mtune=generic -march=pentium-m -Os -mstackrealign -fomit-frame-pointer
The generated output became quite strange over the time. I wonder why the bww builds use "-idirafter" twice. Some argument passing problems? Your line for g++ has only one. I don't think that tools differ so much. In my opinion this include directory there is completely useless but if it's required nowadays. It became introduced after the ESR10 builds. Even your GCC 4.4.6 builds show:
"g++    gcc version 4.4.6 (GCC) ..."
without any C include dir. ESR10 builds using the original C++ compiler (from UDK) show here "cc" and "CC" btw.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: Oddities with Youtube.
« Reply #35 on: November 24, 2017, 07:27:45 am »
Hi Andreas,
Without the CPPFLAGS=-idirafter the build dies here,
Code: [Select]
150:27.99 In file included from K:/usr/include/os2.h:37:0,
150:28.00                  from C:/work/cc45esr/mozilla/widget/os2/nsAppShell.h:11,
150:28.00                  from C:/work/cc45esr/mozilla/widget/os2/nsAppShell.cpp:6:
150:28.00 K:/usr/include/os2tk.h:11:20: fatal error: os2def.h: No such file or directory
150:28.00  #include <os2def.h>
150:28.00                     ^
150:28.00 compilation terminated.
As for why dmik has two -idirafter, it's probably just the way he passes options to configure, or has it in his environment where I use a mozconfig along with having the idirafter parameter in my config.site and run mach or make -f client,mk which automatically runs configure.

ak120

  • Guest
Re: Oddities with Youtube.
« Reply #36 on: November 24, 2017, 03:45:43 pm »
Hi Andreas,
Without the CPPFLAGS=-idirafter the build dies here,
Code: [Select]
150:27.99 In file included from K:/usr/include/os2.h:37:0,
150:28.00                  from C:/work/cc45esr/mozilla/widget/os2/nsAppShell.h:11,
150:28.00                  from C:/work/cc45esr/mozilla/widget/os2/nsAppShell.cpp:6:
150:28.00 K:/usr/include/os2tk.h:11:20: fatal error: os2def.h: No such file or directory
150:28.00  #include <os2def.h>
150:28.00                     ^
150:28.00 compilation terminated.
Thanks for testing it. Does it also complain the same way when toolkit headers reside under the same drive letter C? I was thinking that gcc and g++ are still using the same preprocessor. I'm not an expert in C++ (and have almost no knowledge about g++) but would ask: Which variables for CXX and CXXFLAGS are used by GNU make?

Quote
As for why dmik has two -idirafter, it's probably just the way he passes options to configure, or has it in his environment where I use a mozconfig along with having the idirafter parameter in my config.site and run mach or make -f client,mk which automatically runs configure.
Unfortunately there's no SRPM available to check it. It seems that the repos only offer binaries?

Sorry for driving this thread off-topic and asking too many questions. My American language skills are quite limited without any flavour enhancers.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: Oddities with Youtube.
« Reply #37 on: November 25, 2017, 01:06:16 am »
Thanks for testing it. Does it also complain the same way when toolkit headers reside under the same drive letter C?

Yes.
Back before Bitwise started working on Mozilla using the RPM environment, we just simply had the toolkit headers at the end of the C_INCLUDE_PATH and CPLUS_INCLUDE_PATH. GCC 4.92 is not happy with that and there are conflicts between the headers.

Quote
I was thinking that gcc and g++ are still using the same preprocessor. I'm not an expert in C++ (and have almost no knowledge about g++) but would ask: Which variables for CXX and CXXFLAGS are used by GNU make?

Well make can use any variables, but usually use CXX=g++ and CXXFLAGS=-whatever. Here's a snippet from flac's makefile,
Code: [Select]
CC = gcc -std=gnu99
CCAS = gcc -std=gnu99
CCASDEPMODE = depmode=gcc3
CCASFLAGS =
CCDEPMODE = depmode=gcc3
CFLAGS = -O3 -funroll-loops -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return -Wcast-align -Wnested-externs -Wshadow -Wundef -Wmissing-declarations -Winline  -Wdeclaration-after-statement -msse2
CPP = gcc -std=gnu99 -E
CPPFLAGS =  -D_FORTIFY_SOURCE=2
CXX = g++
CXXCPP = g++ -E
CXXDEPMODE = depmode=gcc3
CXXFLAGS =  -Wall -Wextra -Wcast-align -Wshadow -Wwrite-strings -Wctor-dtor-privacy -Wnon-virtual-dtor -Wreorder -Wsign-promo -Wundef  -Weffc++

Quote
Unfortunately there's no SRPM available to check it. It seems that the repos only offer binaries?

I'd guess source RPM's will become available once the RPM is officially released. I'd like to look at it so I can build RPMs of SM and TB for Arca Noae
Quote
Sorry for driving this thread off-topic and asking too many questions. My American language skills are quite limited without any flavour enhancers.