Solve issues with hip-vdi runtime static lib

1.Combine libamdhip64_static_base.a and libamdvdi_static.a into libamdhip64_static.a.
2.Let hipcc use -use-staticlib to link libamdhip64_static.a.
3.Add some samples for static lib.
4.Fix compiling failure of code object.
Change-Id: Ia2333622a8d05639b90974c4c5d3d85654ba0138
This commit is contained in:
Tao Sang
2020-04-06 09:58:35 -04:00
committed by Tao Sang
parent 85fdbb85a2
commit 4c2ab3f41e
6 changed files with 46 additions and 13 deletions
+10 -4
View File
@@ -211,10 +211,7 @@ if ($HIP_PLATFORM eq "clang") {
$HIPCXXFLAGS .= " -isystem $HIP_CLANG_INCLUDE_PATH/..";
$HIPCFLAGS .= " -isystem $HIP_CLANG_INCLUDE_PATH/..";
$HIPLDFLAGS .= " -L$HIP_LIB_PATH";
if (not $isWindows) {
$HIPLDFLAGS .= " -Wl,--rpath-link=$HIP_LIB_PATH";
$HIPLDFLAGS .= " -lhip_hcc";
} else {
if ($isWindows) {
$HIPLDFLAGS .= " -lamdhip64";
}
if ($HIP_CLANG_HCC_COMPAT_MODE) {
@@ -480,6 +477,7 @@ foreach $arg (@ARGV)
{
$linkType = 0;
$setLinkType = 1;
$swallowArg = 1;
}
if(($trimarg eq '-use-sharedlib') and ($setLinkType eq 0))
{
@@ -770,6 +768,14 @@ if ($HIP_PLATFORM eq "clang") {
if (not $isWindows) {
$HIPLDFLAGS .= " -lgcc_s -lgcc -lpthread -lm";
}
if (not $isWindows and not $compileOnly) {
if ($linkType eq 0) {
$toolArgs .= " -L$HIP_LIB_PATH -lamdhip64_static -L$ROCM_PATH/lib -lhsa-runtime64 -ldl ";
} else {
$toolArgs .= " -Wl,--enable-new-dtags -Wl,--rpath=$HIP_LIB_PATH:$ROCM_PATH/lib -lhip_hcc ";
}
}
}