Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
steam-runtime-tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
steamrt
steam-runtime-tools
Commits
efc6b559
Commit
efc6b559
authored
7 years ago
by
Vivek Das Mohapatra
Browse files
Options
Downloads
Patches
Plain Diff
Fix indentation in generated stub library
parent
cf2738cb
No related branches found
No related tags found
1 merge request
!311
Build capsule-capture-libs from a bundled copy of libcapsule
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
generate-stublib.sh
+38
-38
38 additions, 38 deletions
generate-stublib.sh
with
38 additions
and
38 deletions
generate-stublib.sh
+
38
−
38
View file @
efc6b559
...
@@ -76,7 +76,7 @@ do
...
@@ -76,7 +76,7 @@ do
case
$excluded
in
lib
*
)
printf
"%32s
\"
%s
\"
,
\n
"
""
$excluded
;
;;
esac
;
case
$excluded
in
lib
*
)
printf
"%32s
\"
%s
\"
,
\n
"
""
$excluded
;
;;
esac
;
done
<
$proxy_excluded
;
done
<
$proxy_excluded
;
cat
-
<<
EOF
cat
-
<<
EOF
NULL };
NULL };
EOF
EOF
if
[
-f
${
dlopen_file
}
]
;
if
[
-f
${
dlopen_file
}
]
;
...
@@ -110,49 +110,49 @@ cat - <<EOF
...
@@ -110,49 +110,49 @@ cat - <<EOF
static void __attribute__ ((constructor)) _capsule_init (void)
static void __attribute__ ((constructor)) _capsule_init (void)
{
{
int capsule_errno = 0;
int capsule_errno = 0;
char *capsule_error = NULL;
char *capsule_error = NULL;
// this is an array of the functions we want to act as a shim for:
// this is an array of the functions we want to act as a shim for:
capsule_item_t relocs[] =
capsule_item_t relocs[] =
{
{
EOF
EOF
while
read
sym x
;
do
echo
" {
\"
$sym
\"
},"
;
done
<
$symbol_file
;
while
read
sym x
;
do
echo
" {
\"
$sym
\"
},"
;
done
<
$symbol_file
;
cat
-
<<
EOF
cat
-
<<
EOF
{ NULL }
{ NULL }
};
};
// and this is an aray of functions we must override in the DSOs
// and this is an aray of functions we must override in the DSOs
// inside the capsule (mostly to take account of the fact that
// inside the capsule (mostly to take account of the fact that
// they're pulled in from a tree with a filesystem prefix like /host)
// they're pulled in from a tree with a filesystem prefix like /host)
// NOTE: the shim address here isn't used, but we give it the same
// NOTE: the shim address here isn't used, but we give it the same
// value as the real function address so it's never accidentally
// value as the real function address so it's never accidentally
// a value the capsule code will care about:
// a value the capsule code will care about:
capsule_item_t wrappers[] =
capsule_item_t wrappers[] =
{
{
{ "dlopen", (ElfW(Addr)) _dlopen, (ElfW(Addr)) _dlopen },
{ "dlopen", (ElfW(Addr)) _dlopen, (ElfW(Addr)) _dlopen },
{ NULL }
{ NULL }
};
};
symbol_ns = LM_ID_NEWLM;
symbol_ns = LM_ID_NEWLM;
prefix = "/host";
prefix = "/host";
capsule_init();
capsule_init();
dso = capsule_dlmopen( "
$proxied_dso
", prefix, &symbol_ns, wrappers,
dso = capsule_dlmopen( "
$proxied_dso
", prefix, &symbol_ns, wrappers,
0, exclude, &capsule_errno, &capsule_error );
0, exclude, &capsule_errno, &capsule_error );
if( dso )
if( dso )
{
{
capsule_relocate( "
$proxied_dso
", dso, 0, relocs, &capsule_error );
capsule_relocate( "
$proxied_dso
", dso, 0, relocs, &capsule_error );
}
}
else
else
{
{
fprintf( stderr, "capsule_dlmopen() failed: %s
\\
n", capsule_error );
fprintf( stderr, "capsule_dlmopen() failed: %s
\\
n", capsule_error );
exit( 1 );
exit( 1 );
}
}
}
}
EOF
EOF
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment