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_cmdbuf.c \
94 $src_dir/src/amd/common/ac_debug.c \
95 $src_dir/src/amd/common/ac_descriptors.c \
96 $src_dir/src/amd/common/ac_ib_parser.c \
97 $src_dir/src/amd/common/ac_formats.c \
98 $src_dir/src/amd/common/ac_nir.c \
99 $src_dir/src/amd/common/ac_nir_cull.c \
100 $src_dir/src/amd/common/ac_nir_lower_esgs_io_to_mem.c \
101 $src_dir/src/amd/common/ac_nir_lower_global_access.c \
102 $src_dir/src/amd/common/ac_nir_lower_image_opcodes_cdna.c \
103 $src_dir/src/amd/common/ac_nir_lower_ngg.c \
104 $src_dir/src/amd/common/ac_nir_lower_ps.c \
105 $src_dir/src/amd/common/ac_nir_lower_resinfo.c \
106 $src_dir/src/amd/common/ac_nir_lower_subdword_loads.c \
107 $src_dir/src/amd/common/ac_nir_lower_taskmesh_io_to_mem.c \
108 $src_dir/src/amd/common/ac_nir_lower_tess_io_to_mem.c \
109 $src_dir/src/amd/common/ac_nir_lower_tex.c \
110 $src_dir/src/amd/common/ac_nir_meta_cs_blit.c \
111 $src_dir/src/amd/common/ac_nir_meta_cs_clear_copy_buffer.c \
112 $src_dir/src/amd/common/ac_nir_meta_ps_resolve.c \
113 $src_dir/src/amd/common/ac_nir_opt_outputs.c \
114 $src_dir/src/amd/common/ac_nir_opt_shared_append.c \
115 $src_dir/src/amd/common/ac_parse_ib.c \
116 $src_dir/src/amd/common/ac_perfcounter.c \
117 $src_dir/src/amd/common/ac_pm4.c \
118 $src_dir/src/amd/common/ac_shader_util.c \
119 $src_dir/src/amd/common/ac_shader_args.c \
120 $src_dir/src/amd/common/ac_shadowed_regs.c \
121 $src_dir/src/amd/common/ac_gather_context_rolls.c \
122 $src_dir/src/amd/common/ac_gpu_info.c \
123 $src_dir/src/amd/common/ac_surface.c \
124 $src_dir/src/amd/common/ac_surface_meta_address_test.c \
125 $src_dir/src/amd/common/ac_msgpack.c \
126 $src_dir/src/amd/common/ac_rtld.c \
127 $src_dir/src/amd/common/ac_rgp.c \
128 $src_dir/src/amd/common/ac_rgp_elf_object_pack.c \
129 $src_dir/src/amd/common/ac_spm.c \
130 $src_dir/src/amd/common/ac_sqtt.c \
131 $src_dir/src/amd/common/ac_surface_modifier_test.c \
132 $src_dir/src/amd/common/ac_vcn_enc.c \
134 for src_pathname
in $libamd_common_c_pathnames
136 cpp_filename
=$
(basename $src_pathname .c
).cpp.c
137 printf "CPP $src_pathname --> $build_dir/src/amd/common/$cpp_filename\n"
138 $cpp $src_pathname -o $build_dir/src
/amd
/common
/$cpp_filename \
139 -I$cc_internal_fixed_incdir \
140 -I$cc_internal_incdir \
144 -I$build_dir/src
/gallium
/auxiliary \
145 -I$src_dir/src
/gallium
/auxiliary \
146 -I$build_dir/src
/gallium
/include \
147 -I$src_dir/src
/gallium
/include \
148 -I$build_dir/src
/util \
149 -I$src_dir/src
/util \
150 -I$build_dir/src
/mesa \
151 -I$src_dir/src
/mesa \
152 -I$build_dir/src
/amd
/common \
153 -I$src_dir/src
/amd
/common \
154 -I$build_dir/src
/amd \
156 -I$build_dir/src
/compiler
/nir \
157 -I$src_dir/src
/compiler
/nir \
158 -I$build_dir/src
/compiler \
159 -I$src_dir/src
/compiler \
162 -I$build_dir/include \
165 $syslib_cpp_flags_defs \
166 $linux_cpp_flags_defs \
167 $cc_builtins_cpp_flags_defs \
168 $cc_attributes_cpp_flags_defs \
169 $mesa_cpp_flags_defs \
171 $external_deps_cpp_flags &
173 #-------------------------------------------------------------------------------
175 #------------------------------------------------------------------------------
176 for src_pathname
in $libamd_common_c_pathnames
178 cpp_filename
=$
(basename $src_pathname .c
).cpp.c
179 asm_filename
=$
(basename $src_pathname .c
).cpp.c.s
180 printf "CC_S $build_dir/src/amd/common/$cpp_filename --> $build_dir/src/amd/common/$asm_filename\n"
181 $cc_s $build_dir/src
/amd
/common
/$cpp_filename -o $build_dir/src
/amd
/common
/$asm_filename &
183 #------------------------------------------------------------------------------
185 #------------------------------------------------------------------------------
187 for src_pathname
in $libamd_common_c_pathnames
189 asm_filename
=$
(basename $src_pathname .c
).cpp.c.s
190 o_filename
=$
(basename $src_pathname .c
).cpp.c.s.o
191 os
="$os $build_dir/src/amd/common/$o_filename"
192 printf "AS $build_dir/src/amd/common/$asm_filename --> $build_dir/src/amd/common/$o_filename\n"
193 $as $build_dir/src
/amd
/common
/$asm_filename -o $build_dir/src
/amd
/common
/$o_filename &
195 #------------------------------------------------------------------------------
197 #------------------------------------------------------------------------------
198 printf "AR RCS $build_dir/libamd_common.a $os\n"
199 $ar_rcs $build_dir/libamd_common.a
$os
200 #===============================================================================
201 echo "<--AMD GPU related common components built"