Remove Unusued arguments -pie and -static-libstdc++ in clang80 and clang80++

Resolves: [COMPMID-4977]
Change-Id: If44cb02dbb7e537b135c5ade529f41857133423a
Signed-off-by: Mohammed Suhail Munshi <MohammedSuhail.Munshi@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/6846
Reviewed-by: Gunes Bayir <gunes.bayir@arm.com>
Comments-Addressed: Gunes Bayir <gunes.bayir@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
diff --git a/SConscript b/SConscript
index afff4e5..8d5e608 100644
--- a/SConscript
+++ b/SConscript
@@ -92,13 +92,18 @@
 
 
 def build_library(name, build_env, sources, static=False, libs=[]):
+    cloned_build_env = build_env.Clone()
+    if env['os'] == 'android' and static == False: 
+        cloned_build_env["LINKFLAGS"].remove('-pie')
+        cloned_build_env["LINKFLAGS"].remove('-static-libstdc++')
+
     if static:
-        obj = build_env.StaticLibrary(name, source=sources, LIBS = arm_compute_env["LIBS"] + libs)
+        obj = cloned_build_env.StaticLibrary(name, source=sources, LIBS = arm_compute_env["LIBS"] + libs)
     else:
         if env['set_soname']:
-            obj = build_env.SharedLibrary(name, source=sources, SHLIBVERSION = SONAME_VERSION, LIBS = arm_compute_env["LIBS"] + libs)
+            obj = cloned_build_env.SharedLibrary(name, source=sources, SHLIBVERSION = SONAME_VERSION, LIBS = arm_compute_env["LIBS"] + libs)
         else:
-            obj = build_env.SharedLibrary(name, source=sources, LIBS = arm_compute_env["LIBS"] + libs)
+            obj = cloned_build_env.SharedLibrary(name, source=sources, LIBS = arm_compute_env["LIBS"] + libs)
 
     obj = install_lib(obj)
     Default(obj)