Skip to content

Commit

Permalink
[sb2] Make sure libclang can be loaded properly. JB#59836
Browse files Browse the repository at this point in the history
  • Loading branch information
Franz-Josef Haider authored and krnlyng committed Jan 12, 2023
1 parent e6008a2 commit 3c4cb64
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
15 changes: 15 additions & 0 deletions modes/obs-deb-build/fs_rules.lua
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ emulate_mode_rules_usr_bin = {
actions=accelerated_program_actions},
{path="/usr/bin/bzip2",
actions=accelerated_program_actions},
{path="/usr/bin/clang",
actions=accelerated_program_actions},
{path="/usr/bin/clang++",
actions=accelerated_program_actions},
{path="/usr/bin/cksum",
actions=accelerated_program_actions},
{path="/usr/bin/cmp",
Expand Down Expand Up @@ -524,6 +528,17 @@ emulate_mode_rules_usr = {
protection = readonly_fs_always},

{dir = "/usr/lib/gcc", actions = test_first_tools_then_target_default_is_tools},
-- Clang is a bit special, it doesn't have it's own folder for libclang.so, but
-- we still need to use the proper version
-- It first tries libclang.so which may exist on the target but not tooling
{path = "/usr/lib/libclang.so", force_orig_path = true},
{path = "/usr/lib64/libclang.so", force_orig_path = true},
{prefix = "/usr/lib/libclang.so.", map_to = tools},
{prefix = "/usr/lib64/libclang.so.", map_to = tools},
{path = "/usr/lib/libclang-cpp.so", force_orig_path = true},
{path = "/usr/lib64/libclang-cpp.so", force_orig_path = true},
{prefix = "/usr/lib/libclang-cpp.so.", map_to = tools},
{prefix = "/usr/lib64/libclang-cpp.so.", map_to = tools},

{prefix = "/usr/lib/perl", actions = perl_lib_test},

Expand Down
15 changes: 15 additions & 0 deletions modes/obs-rpm-build+pp/fs_rules.lua
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,10 @@ emulate_mode_rules_usr_bin = {
actions=accelerated_program_actions},
{path="/usr/bin/cargo",
actions=accelerated_program_actions},
{path="/usr/bin/clang",
actions=accelerated_program_actions},
{path="/usr/bin/clang++",
actions=accelerated_program_actions},
{path="/usr/bin/cksum",
actions=accelerated_program_actions},
{path="/usr/bin/cmp",
Expand Down Expand Up @@ -641,6 +645,17 @@ emulate_mode_rules_usr = {
protection = readonly_fs_always},

{dir = "/usr/lib/gcc", actions = test_first_tools_then_target_default_is_tools},
-- Clang is a bit special, it doesn't have it's own folder for libclang.so, but
-- we still need to use the proper version
-- It first tries libclang.so which may exist on the target but not tooling
{path = "/usr/lib/libclang.so", force_orig_path = true},
{path = "/usr/lib64/libclang.so", force_orig_path = true},
{prefix = "/usr/lib/libclang.so.", map_to = tools},
{prefix = "/usr/lib64/libclang.so.", map_to = tools},
{path = "/usr/lib/libclang-cpp.so", force_orig_path = true},
{path = "/usr/lib64/libclang-cpp.so", force_orig_path = true},
{prefix = "/usr/lib/libclang-cpp.so.", map_to = tools},
{prefix = "/usr/lib64/libclang-cpp.so.", map_to = tools},

{prefix = "/usr/lib/perl", actions = perl_lib_test},

Expand Down
15 changes: 15 additions & 0 deletions modes/obs-rpm-build/fs_rules.lua
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ emulate_mode_rules_usr_bin = {
actions=accelerated_program_actions},
{path="/usr/bin/cargo",
actions=accelerated_program_actions},
{path="/usr/bin/clang",
actions=accelerated_program_actions},
{path="/usr/bin/clang++",
actions=accelerated_program_actions},
{path="/usr/bin/cksum",
actions=accelerated_program_actions},
{path="/usr/bin/cmp",
Expand Down Expand Up @@ -495,6 +499,17 @@ emulate_mode_rules_usr = {
protection = readonly_fs_always},

{dir = "/usr/lib/gcc", actions = test_first_tools_then_target_default_is_tools},
-- Clang is a bit special, it doesn't have it's own folder for libclang.so, but
-- we still need to use the proper version
-- It first tries libclang.so which may exist on the target but not tooling
{path = "/usr/lib/libclang.so", force_orig_path = true},
{path = "/usr/lib64/libclang.so", force_orig_path = true},
{prefix = "/usr/lib/libclang.so.", map_to = tools},
{prefix = "/usr/lib64/libclang.so.", map_to = tools},
{path = "/usr/lib/libclang-cpp.so", force_orig_path = true},
{path = "/usr/lib64/libclang-cpp.so", force_orig_path = true},
{prefix = "/usr/lib/libclang-cpp.so.", map_to = tools},
{prefix = "/usr/lib64/libclang-cpp.so.", map_to = tools},

-- If a program from tools loads plugins,
-- they should be dlopened from tools as well.
Expand Down

0 comments on commit 3c4cb64

Please sign in to comment.