1 echo "building AMD GPU related common component-->"
2 #===============================================================================
3 # AMD/addrlib... AMD did not get the memo about c++ toxicity.
4 #------------------------------------------------------------------------------
5 mkdir
-p $build_dir/src
/amd
/addrlib
6 #------------------------------------------------------------------------------
7 # filenames must be different as we put everything in one directory
8 libaddrlib_cxx_pathnames
="\
9 $src_dir/src/amd/addrlib/src/addrinterface.cpp \
10 $src_dir/src/amd/addrlib/src/core/addrelemlib.cpp \
11 $src_dir/src/amd/addrlib/src/core/addrlib.cpp \
12 $src_dir/src/amd/addrlib/src/core/addrlib1.cpp \
13 $src_dir/src/amd/addrlib/src/core/addrlib2.cpp \
14 $src_dir/src/amd/addrlib/src/core/addrlib3.cpp \
15 $src_dir/src/amd/addrlib/src/core/addrobject.cpp \
16 $src_dir/src/amd/addrlib/src/core/coord.cpp \
17 $src_dir/src/amd/addrlib/src/gfx12/gfx12addrlib.cpp \
18 $src_dir/src/amd/addrlib/src/gfx11/gfx11addrlib.cpp \
19 $src_dir/src/amd/addrlib/src/gfx10/gfx10addrlib.cpp \
20 $src_dir/src/amd/addrlib/src/gfx9/gfx9addrlib.cpp \
21 $src_dir/src/amd/addrlib/src/r800/ciaddrlib.cpp \
22 $src_dir/src/amd/addrlib/src/r800/egbaddrlib.cpp \
23 $src_dir/src/amd/addrlib/src/r800/siaddrlib.cpp \
25 for src_pathname
in $libaddrlib_cxx_pathnames
27 cxxpp_filename
=$
(basename $src_pathname .cpp
).cpp.cxx
28 printf "CXXPP $src_pathname --> $build_dir/src/amd/addrlib/$cxxpp_filename\n"
29 $cxxpp $src_pathname -o $build_dir/src
/amd
/addrlib
/$cxxpp_filename \
30 -I$cc_internal_fixed_incdir \
31 -I$cc_internal_incdir \
32 -I$cxx_internal_incdir \
37 -I$build_dir/src
/amd
/addrlib
/src
/chip
/r800 \
38 -I$src_dir/src
/amd
/addrlib
/src
/chip
/r800 \
39 -I$build_dir/src
/amd
/addrlib
/src
/chip
/gfx9 \
40 -I$src_dir/src
/amd
/addrlib
/src
/chip
/gfx9 \
41 -I$build_dir/src
/amd
/addrlib
/src
/chip
/gfx10 \
42 -I$src_dir/src
/amd
/addrlib
/src
/chip
/gfx10 \
43 -I$build_dir/src
/amd
/addrlib
/src
/chip
/gfx11 \
44 -I$src_dir/src
/amd
/addrlib
/src
/chip
/gfx11 \
45 -I$build_dir/src
/amd
/addrlib
/src
/chip
/gfx12 \
46 -I$src_dir/src
/amd
/addrlib
/src
/chip
/gfx12 \
47 -I$build_dir/src
/amd
/addrlib
/src
/core \
48 -I$src_dir/src
/amd
/addrlib
/src
/core \
49 -I$build_dir/src
/amd
/addrlib
/src \
50 -I$src_dir/src
/amd
/addrlib
/src \
51 -I$build_dir/src
/amd
/addrlib
/inc \
52 -I$src_dir/src
/amd
/addrlib
/inc \
55 -I$build_dir/include \
58 #------------------------------------------------------------------------------
60 #------------------------------------------------------------------------------
61 for src_pathname
in $libaddrlib_cxx_pathnames
63 cxxpp_filename
=$
(basename $src_pathname .cpp
).cpp.cxx
64 asm_filename
=$
(basename $src_pathname .cpp
).cpp.cxx.s
65 printf "CXX_S $build_dir/src/amd/addrlib/$cxxpp_filename --> $build_dir/src/amd/addrlib/$asm_filename\n"
66 $cxx_s $build_dir/src
/amd
/addrlib
/$cxxpp_filename -o $build_dir/src
/amd
/addrlib
/$asm_filename &
68 #------------------------------------------------------------------------------
70 #------------------------------------------------------------------------------
72 for src_pathname
in $libaddrlib_cxx_pathnames
74 asm_filename
=$
(basename $src_pathname .cpp
).cpp.cxx.s
75 o_filename
=$
(basename $src_pathname .cpp
).cpp.cxx.s.o
76 os
="$os $build_dir/src/amd/addrlib/$o_filename"
77 printf "AS $build_dir/src/amd/addrlib/$asm_filename --> $build_dir/src/amd/addrlib/$o_filename\n"
78 $as $build_dir/src
/amd
/addrlib
/$asm_filename -o $build_dir/src
/amd
/addrlib
/$o_filename &
80 #------------------------------------------------------------------------------
82 #------------------------------------------------------------------------------
83 printf "AR RCS $build_dir/libaddrlib.a $os\n"
84 $ar_rcs $build_dir/libaddrlib.a
$os
85 #===============================================================================
87 #------------------------------------------------------------------------------
88 mkdir
-p $build_dir/src
/amd
/common
89 #------------------------------------------------------------------------------
90 libamd_common_c_pathnames
="\
91 $src_dir/src/amd/common/amd_family.c \
92 $src_dir/src/amd/common/ac_binary.c \
93 $src_dir/src/amd/common/ac_debug.c \
94 $src_dir/src/amd/common/ac_descriptors.c \
95 $src_dir/src/amd/common/ac_ib_parser.c \
96 $src_dir/src/amd/common/ac_formats.c \
97 $src_dir/src/amd/common/ac_nir.c \
98 $src_dir/src/amd/common/ac_nir_cull.c \
99 $src_dir/src/amd/common/ac_nir_lower_esgs_io_to_mem.c \
100 $src_dir/src/amd/common/ac_nir_lower_global_access.c \
101 $src_dir/src/amd/common/ac_nir_lower_image_opcodes_cdna.c \
102 $src_dir/src/amd/common/ac_nir_lower_ngg.c \
103 $src_dir/src/amd/common/ac_nir_lower_ps.c \
104 $src_dir/src/amd/common/ac_nir_lower_resinfo.c \
105 $src_dir/src/amd/common/ac_nir_lower_subdword_loads.c \
106 $src_dir/src/amd/common/ac_nir_lower_taskmesh_io_to_mem.c \
107 $src_dir/src/amd/common/ac_nir_lower_tess_io_to_mem.c \
108 $src_dir/src/amd/common/ac_nir_lower_tex.c \
109 $src_dir/src/amd/common/ac_nir_opt_outputs.c \
110 $src_dir/src/amd/common/ac_parse_ib.c \
111 $src_dir/src/amd/common/ac_perfcounter.c \
112 $src_dir/src/amd/common/ac_shader_util.c \
113 $src_dir/src/amd/common/ac_shader_args.c \
114 $src_dir/src/amd/common/ac_shadowed_regs.c \
115 $src_dir/src/amd/common/ac_gather_context_rolls.c \
116 $src_dir/src/amd/common/ac_gpu_info.c \
117 $src_dir/src/amd/common/ac_surface.c \
118 $src_dir/src/amd/common/ac_surface_meta_address_test.c \
119 $src_dir/src/amd/common/ac_msgpack.c \
120 $src_dir/src/amd/common/ac_rtld.c \
121 $src_dir/src/amd/common/ac_rgp.c \
122 $src_dir/src/amd/common/ac_rgp_elf_object_pack.c \
123 $src_dir/src/amd/common/ac_spm.c \
124 $src_dir/src/amd/common/ac_sqtt.c \
125 $src_dir/src/amd/common/ac_surface_modifier_test.c \
127 for src_pathname
in $libamd_common_c_pathnames
129 cpp_filename
=$
(basename $src_pathname .c
).cpp.c
130 printf "CPP $src_pathname --> $build_dir/src/amd/common/$cpp_filename\n"
131 $cpp $src_pathname -o $build_dir/src
/amd
/common
/$cpp_filename \
132 -I$cc_internal_fixed_incdir \
133 -I$cc_internal_incdir \
137 -I$build_dir/src
/gallium
/auxiliary \
138 -I$src_dir/src
/gallium
/auxiliary \
139 -I$build_dir/src
/gallium
/include \
140 -I$src_dir/src
/gallium
/include \
141 -I$build_dir/src
/util \
142 -I$src_dir/src
/util \
143 -I$build_dir/src
/mesa \
144 -I$src_dir/src
/mesa \
145 -I$build_dir/src
/amd
/common \
146 -I$src_dir/src
/amd
/common \
147 -I$build_dir/src
/amd \
149 -I$build_dir/src
/compiler
/nir \
150 -I$src_dir/src
/compiler
/nir \
151 -I$build_dir/src
/compiler \
152 -I$src_dir/src
/compiler \
155 -I$build_dir/include \
158 $syslib_cpp_flags_defs \
159 $linux_cpp_flags_defs \
160 $cc_builtins_cpp_flags_defs \
161 $cc_attributes_cpp_flags_defs \
162 $mesa_cpp_flags_defs \
164 $external_deps_cpp_flags &
166 #-------------------------------------------------------------------------------
168 #------------------------------------------------------------------------------
169 for src_pathname
in $libamd_common_c_pathnames
171 cpp_filename
=$
(basename $src_pathname .c
).cpp.c
172 asm_filename
=$
(basename $src_pathname .c
).cpp.c.s
173 printf "CC_S $build_dir/src/amd/common/$cpp_filename --> $build_dir/src/amd/common/$asm_filename\n"
174 $cc_s $build_dir/src
/amd
/common
/$cpp_filename -o $build_dir/src
/amd
/common
/$asm_filename &
176 #------------------------------------------------------------------------------
178 #------------------------------------------------------------------------------
180 for src_pathname
in $libamd_common_c_pathnames
182 asm_filename
=$
(basename $src_pathname .c
).cpp.c.s
183 o_filename
=$
(basename $src_pathname .c
).cpp.c.s.o
184 os
="$os $build_dir/src/amd/common/$o_filename"
185 printf "AS $build_dir/src/amd/common/$asm_filename --> $build_dir/src/amd/common/$o_filename\n"
186 $as $build_dir/src
/amd
/common
/$asm_filename -o $build_dir/src
/amd
/common
/$o_filename &
188 #------------------------------------------------------------------------------
190 #------------------------------------------------------------------------------
191 printf "AR RCS $build_dir/libamd_common.a $os\n"
192 $ar_rcs $build_dir/libamd_common.a
$os
193 #===============================================================================
194 echo "<--AMD GPU related common components built"