Commit 6963f34c authored by Yuanle Song's avatar Yuanle Song
Browse files

add doc on using faster link lld. it's not there yet.

parent 480c92f7
Loading
Loading
Loading
Loading
+43 −1
Original line number Diff line number Diff line
* COMMENT -*- mode: org -*-
#+Date: 2018-05-04
Time-stamp: <2024-04-26>
Time-stamp: <2024-06-05>
#+STARTUP: content
* notes                                                               :entry:
** 2022-03-14 project dir structure
@@ -371,6 +371,48 @@ https://artyom.me/aeson
** 2018-05-06 optparse-applicative :: Stackage Server
https://www.stackage.org/lts-10.3/package/optparse-applicative-0.14.0.0
* later                                                               :entry:
** 2024-06-04 switch to a faster linker.
- switch to clang and lld failed.
- try gold
  gold works.
  file size is the same. check link speed.

  with ld
  tmake stack build
  5s

  with gold
  tmake stack build
  5s

  I see no difference.
  is gold being used at all?
- try add
  -pgml ld.gold

  ghc-options:
    - -optl-fuse-ld=gold
    - -pgml ld.gold
  ld-options:
    - -fuse-ld=gold

  now I see an error.
  #+begin_src sh
    [3 of 3] Linking .stack-work/dist/x86_64-linux/ghc-9.4.8/build/maybet/maybet [Flags changed]

    <no location info>: error:
	Warning: Couldn't figure out linker information!
		 Make sure you're using GNU ld, GNU gold or the built in OS X linker, etc.
    ld.gold: -Wl,--gc-sections: unknown option
    ld.gold: use the --help option for usage information
    ghc-9.4.8: `ld.gold' failed in phase `Linker'. (Exit code: 1)
  #+end_src

  search: ld.gold: -Wl,--gc-sections: unknown option
- haskell stack document has no doc on using clang or lld.
  maybe try build with cabal?
- lld support is not good yet. wait for some time for it to mature.

** 2022-03-12 drop redis-server as rd-api dependency.            :featurereq:
- use a built-in key-value db. such as Berkeley db, sqlite3, or leveldb.
  use a well known path for the db name.