• Home
Name Date Size #Lines LOC

..--

source/03-May-2024-832,814792,412

OWNERSD03-May-202419 21

README.chromiumD03-May-20245.6 KiB13898

config_sources.host.darwin-x86.mkD03-May-20243.9 KiB160118

config_sources.host.linux-x86.mkD03-May-20243.9 KiB160118

generate_files.host.darwin-x86.mkD03-May-20249.3 KiB217159

generate_files.host.linux-x86.mkD03-May-20249.3 KiB217159

genmacro.host.darwin-x86.mkD03-May-20244.4 KiB181131

genmacro.host.linux-x86.mkD03-May-20244.4 KiB185135

genmodule.host.darwin-x86.mkD03-May-20244.4 KiB181131

genmodule.host.linux-x86.mkD03-May-20244.4 KiB185135

genperf.host.darwin-x86.mkD03-May-20244.6 KiB184134

genperf.host.linux-x86.mkD03-May-20244.6 KiB188138

genperf_libs.host.darwin-x86.mkD03-May-20244.5 KiB187137

genperf_libs.host.linux-x86.mkD03-May-20244.6 KiB191141

genstring.host.darwin-x86.mkD03-May-20244.3 KiB181131

genstring.host.linux-x86.mkD03-May-20244.4 KiB185135

genversion.host.darwin-x86.mkD03-May-20244.4 KiB181131

genversion.host.linux-x86.mkD03-May-20244.4 KiB185135

re2c.host.darwin-x86.mkD03-May-20244.8 KiB189139

re2c.host.linux-x86.mkD03-May-20244.9 KiB193143

yasm.gypD03-May-202420.6 KiB579567

yasm.host.darwin-x86.mkD03-May-202422.9 KiB406318

yasm.host.linux-x86.mkD03-May-202423 KiB410322

yasm_compile.gypiD03-May-20243.1 KiB120112

README.chromium

1Name: yasm
2URL: http://www.tortall.net/projects/yasm/
3Version: 1.2.0
4License: 2-clause or 3-clause BSD licensed, with the exception of bitvect, which is triple-licensed under the Artistic license, GPL, and LGPL
5License File: source/patched-yasm/COPYING
6License Android Compatible: yes
7Security Critical: no
8
9With these patches merged:
10* https://github.com/yasm/yasm/commit/a2cbb10ee1b90b73647667ac849c74d65761d412
11* https://github.com/yasm/yasm/commit/01ab853e68ef8aeded716d6f5b34895200f66a51
12* https://github.com/yasm/yasm/commit/82fafa7b5619e702c8681c959ade0746498e3cbc
13* https://github.com/yasm/yasm/commit/2bd66514b6b100887c19d8598da38347b3cff40e
14* https://github.com/yasm/yasm/commit/ab19547382660d81e0b4a0232dccb38f44c52a36
15* https://github.com/yasm/yasm/commit/9728322335cba96500861ef766b1546d096e5600
16
17
18See also the yasm.gyp file for a description of the yasm build process.
19
20Instructions for recreating the yasm.gyp file.
21  1) Get a clean version of the yasm source tree. The clean tree can be found
22     at:
23
24       src/third_party/yasm/source/yasm
25
26  2) Run configure on the pristine source from a different directory (eg.,
27     /tmp/yasm_build).  Running configure from another directory will keep
28     the source tree clean.
29
30  3) Next, capture all the output from a build of yasm.  We will use the build
31     log as a reference for making the yasm.gyp file.
32
33       make yasm > yasm_build_log 2> yasm_build_err
34
35  4) Check yasm_build_err to see if there are any anomalies beyond yasm's
36     compiler warnings.
37
38  5) Grab the generated Makefile, libyasm-stdint.h, config.h, and put into
39     the correct platform location. For android platform, copy the files
40     generated for linux.  For ios, copy the files from mac.
41
42       src/third_party/yasm/source/config/[platform]
43
44     While we do not directly use the "Makefile" to build, it is needed by
45     the "genmodule" subprogram as input for creating the available modules
46     list.
47
48  6) Make sure all the subprograms are represented in yasm.gyp.
49
50       grep '^gcc' yasm_build_log  |
51       grep -v ' -DHAVE_CONFIG_H '
52
53     The yasm build creates a bunch of subprograms that in-turn generate
54     more .c files in the build. Luckily the commands to generate the
55     subprogram do not have -DHAVE_CONFIG_H as a cflag.
56
57     From this list, make sure all the subprograms that are build have
58     appropriate targets in the yasm.gyp.
59
60     You will notice, when you get to the next step, that there are some
61     .c source files that are compiled both for yasm, and for genperf.
62
63     Those should go into the genperf_libs target so that they can be
64     shared by the genperf and yasm targets.  Find those files by appending
65
66       | grep 'gp-'
67
68     to the command above.
69
70  7) Find all the source files used to build yasm proper.
71
72       grep -E '^gcc' yasm_build_log  |
73       grep ' -DHAVE_CONFIG_H ' |
74       awk '{print $NF }' |
75       sed -e "s/'\.\/'\`//" |  # Removes some garbage from the build line.
76       sort -u |
77       sed -e "s/\(.*\)/'\1',/"  # Add quotes to each line.
78
79     Reversing the -DHAVE_CONFIG_H filter from the command above should
80     list the compile lines for yasm proper.
81
82     This should get you close, but you will need to manually examine this
83     list.  However, some of the built products are still included in the
84     command above.  Generally, if the source file is in the root directory,
85     it's a generated file.
86
87     Inspect the current yasm.gyp for a list of the subprograms and their
88     outputs.
89
90     Update the sources list in the yasm target accordingly.  Read step #9
91     as well if you update the source list to avoid problems.
92
93  8) Update the actions for each of the subprograms.
94
95     Here is the real fun.  For each subprogram created, you will need to
96     update the actions and rules in yasm.gyp that invoke the subprogram to
97     generate the files needed by the rest of the build.
98
99     I don't have any good succinct instructions for this.  Grep the build
100     log for each subprogram invocation (eg., "./genversion"), look at
101     its command inputs and output, then verify our yasm.gyp does something
102     similar.
103
104     The good news is things likely only link or compile if this is done
105     right so you'll know if there is a problem.
106
107     Again, refer to the existing yasm.gyp for a guide to how the generated
108     files are used.
109
110     Here are a few gotchas:
111       1) genmodule, by default, writes module.c into the current
112          directory.  This does not play nicely with gyp.  We patch the
113          source during build to allow specifying a specific output file.
114
115       2) Most of the generated files, even though they are .c files, are
116          #included by other files in the build.  Make sure they end up
117          in a directory that is in the include path for the build.
118          One of <(shared_generated_dir) or <(generated_dir) should work.
119
120       3) Some of the genperf output is #included while others need to be
121          compiled directly.  That is why there are 2 different rules for
122          .gperf files in two targets.
123
124  9) Check for python scripts that are run.
125
126       grep python yasm_build_log
127
128     Yasm uses python scripts to generate the assembly code description
129     files in C++. Make sure to get these put into the gyp file properly as
130     well.  An example is gen_x86_insn.py for x86 assembly.
131
132     Note that at least the gen_x86_insn.py script suffers from the same
133     problem as genmacro in that it outputs to the current directory by
134     default.  The yasm.gyp build patches this file before invoking it to
135     allow specifying an output directory.
136
137 10) If all that's is finished, attempt to build....and cross your fingers.
138