[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #25834 [Applications/Tor Browser]: Use compiler dependent spec files for mingw-w64



#25834: Use compiler dependent spec files for mingw-w64
-------------------------------------------------+-------------------------
 Reporter:  gk                                   |          Owner:  tbb-
                                                 |  team
     Type:  defect                               |         Status:
                                                 |  needs_review
 Priority:  Medium                               |      Milestone:
Component:  Applications/Tor Browser             |        Version:
 Severity:  Normal                               |     Resolution:
 Keywords:  tbb-rbm, ff60-esr,                   |  Actual Points:
  TorBrowserTeam201804R                          |
Parent ID:  #24631                               |         Points:
 Reviewer:                                       |        Sponsor:
-------------------------------------------------+-------------------------

Comment (by cypherpunks):

 {{{
 mkdir -p builddir/mingw-w64/mingw-w64-headers32
 }}}
 `32` in 64 bit builds might confuse somebody. The same for `crt` and
 `widl`.
 {{{
 # We don't want to link against msvcrt.dll due to bug 9084.
 [% c("arch") %]-w64-mingw32-g++ -dumpspecs > $distdir/msvcr100.spec
 }}}
 `gcc` is the driver program of GCC suite, and it handles the specs
 according to the docs. (So, if it gives the same result in practice,
 please, use it instead of `g++`.)
 `-dumpspecs` dumps specs for all programs invoked by `gcc`, and the
 version you called is what is installed on host, so `gcc-4.9-all.spec` is
 a better wording than `msvcr100.spec`.
 {{{
 # Linking libgcc against msvcrt is hard-coded...
 sed 's/msvcrt/msvcr100/' -i gcc-[% c("var/gcc_version")
 %]/gcc/config/i386/t-mingw-w32
 }}}
 First, we use `t-mingw-w64`. Second, it has nothing relative to `msvcrt`.
 Obsolete?
 {{{
 # LDFLAGS_FOR_TARGET does not work for some reason. Thus, we take
 # CFLAGS_FOR_TARGET.
 }}}
 Linker doesn't want to parse compiler's option? That's normal.
 {{{
 export CFLAGS_FOR_TARGET="-specs=$distdir/msvcr100.spec -Wl,--nxcompat
 -Wl,--dynamicbase"
 }}}
 Export not all `-Wl` flags? Very weird.
 Do you use this line to pass `-specs` for the new compiler only? It can be
 done by adding `--with-specs=$distdir/msvcr100.spec` to the next line:
 {{{
 gcc-[% c("var/gcc_version") %]/configure --prefix=$distdir --target=[%
 c("arch") %]-w64-mingw32 --disable-multilib --enable-languages=c,c++
 }}}
 but WARNING: you're going to overwrite the default specs of the new
 compiler with `gcc-4.9-all.spec` ones! And with
 {{{
 # Update msvcr100.spec with the compiler we have built (#25834)
 $distdir/bin/[% c("arch") %]-w64-mingw32-g++ -dumpspecs >
 $distdir/msvcr100.spec
 sed 's/msvcrt/msvcr100/' -i $distdir/msvcr100.spec
 }}}
 you just read all the specs of the new compiler (with part of them already
 overwritten) and try to replace the (new/remaining?) `msvcrt`s (do they
 really exist?).
 And what is the reason to update and use `msvcr100.spec` file later (in
 `firefox`)? It has become the default config of your compiler already.
 USUAL DISCLAIMER: reviewed, but not built :)

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/25834#comment:7>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs