@@ -199,10 +199,6 @@ BEGIN
199199 print (" HIP_CLANG_RT_LIB=$HIP_CLANG_RT_LIB \n " );
200200 }
201201
202- $HIPLDFLAGS .= " -L\" $HIP_LIB_PATH \" " ;
203- if ($isWindows ) {
204- $HIPLDFLAGS .= " -lamdhip64" ;
205- }
206202 if ($HIP_CLANG_HCC_COMPAT_MODE ) {
207203 # # Allow __fp16 as function parameter and return type.
208204 $HIPCXXFLAGS .= " -Xclang -fallow-half-arguments-and-returns -D__HIP_HCC_COMPAT_MODE__=1" ;
@@ -245,8 +241,6 @@ BEGIN
245241my $printLDFlags = 0; # print HIPLDFLAGS
246242my $runCmd = 1;
247243my $buildDeps = 0;
248- my $linkType = 1;
249- my $setLinkType = 0;
250244my $hsacoVersion = 0;
251245my $funcSupp = 0; # enable function support
252246my $rdc = 0; # whether -fgpu-rdc is on
@@ -361,16 +355,11 @@ BEGIN
361355 $compileOnly = 1;
362356 $buildDeps = 1;
363357 }
364- if (($trimarg eq ' -use-staticlib' ) and ($setLinkType eq 0))
365- {
366- $linkType = 0;
367- $setLinkType = 1;
368- $swallowArg = 1;
358+ if ($trimarg eq ' -use-staticlib' ) {
359+ print " Warning: The -use-staticlib option has been deprecated and is no longer needed.\n "
369360 }
370- if (($trimarg eq ' -use-sharedlib' ) and ($setLinkType eq 0))
371- {
372- $linkType = 1;
373- $setLinkType = 1;
361+ if ($trimarg eq ' -use-sharedlib' ) {
362+ print " Warning: The -use-sharedlib option has been deprecated and is no longer needed.\n "
374363 }
375364 if ($arg =~ m / ^-O/ )
376365 {
@@ -558,12 +547,6 @@ BEGIN
558547 $HIPCXXFLAGS .= " --cuda-host-only" ;
559548}
560549
561- # Add --hip-link only if it is compile only and -fgpu-rdc is on.
562- if ($rdc and !$compileOnly and $HIP_PLATFORM eq ' amd' ) {
563- $HIPLDFLAGS .= " --hip-link" ;
564- $HIPLDFLAGS .= $HIPLDARCHFLAGS ;
565- }
566-
567550# hipcc currrently requires separate compilation of source files, ie it is not possible to pass
568551# CPP files combined with .O files
569552# Reason is that NVCC uses the file extension to determine whether to compile in CUDA mode or
@@ -588,18 +571,16 @@ BEGIN
588571 $HIPCXXFLAGS .= " --hip-device-lib-path=\" $DEVICE_LIB_PATH \" " ;
589572 }
590573 }
591- if (not $isWindows ) {
592- $HIPLDFLAGS .= " -lgcc_s -lgcc -lpthread -lm -lrt" ;
593- }
594574
595- if (not $isWindows and not $compileOnly ) {
596- if ($linkType eq 0) {
597- $toolArgs = " -L$HIP_LIB_PATH -lamdhip64 -L$ROCM_PATH /lib -lhsa-runtime64 -ldl -lnuma " . ${toolArgs} ;
598- } else {
599- $toolArgs = ${toolArgs} . " -Wl,-rpath=$HIP_LIB_PATH :$ROCM_PATH /lib -lamdhip64 " ;
600- }
575+ if (!$compileOnly ) {
576+ $HIPLDFLAGS .= " --hip-link" ;
577+ if ($rdc ) {
578+ $HIPLDFLAGS .= $HIPLDARCHFLAGS ;
579+ }
580+ if (not $isWindows ) {
581+ $HIPLDFLAGS .= " --rtlib=compiler-rt -unwindlib=libgcc" ;
601582
602- $toolArgs .= " -L $HIP_CLANG_RT_LIB -lclang_rt.builtins-x86_64 "
583+ }
603584 }
604585}
605586
0 commit comments