README.pdfium
1Name: yasm
2URL: http://www.tortall.net/projects/yasm/
3Version: 1.3.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
9Source: http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
10SHA-512: 572d3b45568b10f58e48f1188c2d6bcbdd16429c8afaccc8c6d37859b45635e1
11 06885d679e41d0bee78c23822108c7ae75aa7475eed5ba58057e0a6fe1b68645
12
13With these patches applied:
14* CHROMIUM.diff: Combined patch from Chromium.
15 See Chromium's third_party/yasm/README.chromium for details.
16
17
18See also the BUILD.gn file for a description of the yasm build process.
19
20Instructions for recreating the BUILD.gn file.
21 1) Update yasm and re-apply the patches.
22
23 2) Make a copy of source in a different directory (e.g., /tmp/yasm_build) and
24 run configure. Using another directory will keep the source tree clean. An
25 out-of-tree build does not appear to work reliably as of yasm 1.3.0.
26
27 3) Next, capture all the output from a build of yasm. We will use the build
28 log as a reference for BUILD.gn.
29
30 make yasm > yasm_build_log 2> yasm_build_err
31
32 4) Check yasm_build_err to see if there are any anomalies beyond yasm's
33 compiler warnings.
34
35 5) Grab the generated libyasm-stdint.h and config.h and put into the correct
36 platform location.
37
38 src/third_party/yasm/source/config/[platform]
39
40 For android platform, copy the files generated for linux, but make sure
41 that ENABLE_NLS is not defined to allow mac host compiles to work. For
42 ios, copy the files from mac. For win, copy the libyasm-stdint.h from
43 linux and fix up config.h.
44
45 Find the YASM_MODULES line in the generated Makefile and update
46 src/third_party/yasm/source/config/Makefile. It is needed by the
47 "genmodule" subprogram as input for creating the available modules list.
48
49 6) Make sure all the subprograms are represented in BUILD.gn.
50
51 grep -w gcc yasm_build_log |
52 grep -v ' -DHAVE_CONFIG_H '
53
54 The yasm build creates a bunch of subprograms that in-turn generate
55 more .c files in the build. Luckily the commands to generate the
56 subprogram do not have -DHAVE_CONFIG_H as a cflag.
57
58 From this list, make sure all the subprograms that are build have
59 appropriate targets in the BUILD.gn.
60
61 You will notice, when you get to the next step, that there are some
62 .c source files that are compiled both for yasm, and for genperf.
63
64 Those should go into the yasm_utils target so that they can be shared by
65 the genperf and yasm targets. Find the files used by genperf by appending
66
67 | grep 'gp-'
68
69 to the command above. Then grep for them without the 'gp-' prefix to see if
70 they are used in yasm as well.
71
72 7) Find all the source files used to build yasm proper.
73
74 grep -w gcc yasm_build_log |
75 grep ' -DHAVE_CONFIG_H ' |
76 sed -e 's/[&\\]*$//' | # Remove any trailing '&&'s and '\'s.
77 awk '{print $NF }' |
78 sed -e "s/'\.\/'\`//" | # Removes some garbage from the build line.
79 sort -u |
80 sed -e 's/\(.*\)/ "source\/patched-yasm\/\1",/'
81
82 Reversing the -DHAVE_CONFIG_H filter from the command above should
83 list the compile lines for yasm proper.
84
85 This should get you close, but you will need to manually examine this
86 list. However, some of the built products are still included in the
87 command above. Generally, if the source file is in the root directory,
88 it's a generated file. Also remove the sources in the yasm_utils target.
89
90 Inspect the current BUILD.gn for a list of the subprograms and their
91 outputs.
92
93 Update the sources list in the yasm target accordingly. Read step #9
94 as well if you update the source list to avoid problems.
95
96 8) Update the actions for each of the subprograms.
97
98 Here is the real fun. For each subprogram created, you will need to
99 update the actions and rules in BUILD.gn that invoke the subprogram to
100 generate the files needed by the rest of the build.
101
102 I don't have any good succinct instructions for this. Grep the build
103 log for each subprogram invocation (eg., "./genversion"), look at
104 its command inputs and output, then verify our BUILD.gn does something
105 similar.
106
107 The good news is things likely only link or compile if this is done
108 right so you'll know if there is a problem.
109
110 Again, refer to the existing BUILD.gn for a guide to how the generated
111 files are used.
112
113 Here are a few gotchas:
114 1) genmodule, by default, writes module.c into the current
115 directory. This does not play nicely with gn. We have a patch
116 to allow specifying a specific output file.
117
118 2) Most of the generated files, even though they are .c files, are
119 #included by other files in the build. Make sure they end up
120 in yasm_gen_include_dir.
121
122 3) Some of the genperf output is #included while others need to be
123 compiled directly. That is why there are 2 different rules for
124 .gperf files in two targets.
125
126 9) If all that's is finished, attempt to build....and cross your fingers.
127