cros-i686, cros-arm64: Remove unneeded workarounds

Use libc++ and drop workarounds for building 32-bit x86 and
64-bit arm64 static binaries.
Changed "-isystem" to "-idirafter" for <board>/usr/include so that is
used at end rather than beginning and avoids confusing clang because of
headers of a different ABI. "-idirafter" directory is still treated as
a system include directory.

BUG=chromium:991024, chromium:1158137
TEST=CQ

Change-Id: I6cb81c0e5859586b1f46a5a7fd711deb5de002ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/overlays/chromiumos-overlay/+/2586271
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Commit-Queue: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Auto-Submit: Manoj Gupta <manojgupta@chromium.org>
diff --git a/chromeos-base/crash-reporter/crash-reporter-9999.ebuild b/chromeos-base/crash-reporter/crash-reporter-9999.ebuild
index fad90cb..8189e56 100644
--- a/chromeos-base/crash-reporter/crash-reporter-9999.ebuild
+++ b/chromeos-base/crash-reporter/crash-reporter-9999.ebuild
@@ -15,7 +15,7 @@
 inherit cros-arm64 cros-i686 cros-workon platform systemd udev user
 
 DESCRIPTION="Crash reporting service that uploads crash reports with debug information"
-HOMEPAGE="https://chromium.googlesource.com/chromiumos/platform2/+/master/crash-reporter/"
+HOMEPAGE="https://chromium.googlesource.com/chromiumos/platform2/+/HEAD/crash-reporter/"
 
 LICENSE="BSD-Google"
 KEYWORDS="~*"
diff --git a/chromeos-base/google-breakpad/google-breakpad-9999.ebuild b/chromeos-base/google-breakpad/google-breakpad-9999.ebuild
index 6094d75..29702da 100644
--- a/chromeos-base/google-breakpad/google-breakpad-9999.ebuild
+++ b/chromeos-base/google-breakpad/google-breakpad-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+# Copyright 2011 The Chromium OS Authors. All rights reserved.
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
diff --git a/eclass/cros-arm64.eclass b/eclass/cros-arm64.eclass
index 6bc6e30..36440db 100644
--- a/eclass/cros-arm64.eclass
+++ b/eclass/cros-arm64.eclass
@@ -29,14 +29,12 @@
 	if [[ ${CC} == *"clang"* ]]; then
 		export CC=aarch64-cros-linux-gnu-clang
 		export CXX=aarch64-cros-linux-gnu-clang++
-		append-flags "-Xclang-only=-stdlib=libstdc++"
-		append-ldflags "-Xclang-only=-stdlib=libstdc++"
 	fi
 	__AU_OLD_SYSROOT=${SYSROOT}
 	export LIBCHROME_SYSROOT=${SYSROOT}
 	export SYSROOT=/usr/aarch64-cros-linux-gnu
 	append-ldflags -L"${__AU_OLD_SYSROOT}"/usr/lib64 -L"${SYSROOT}"/usr/lib64
-	append-cppflags -isystem "${SYSROOT}"/usr/include
+	append-cppflags -idirafter "${__AU_OLD_SYSROOT}"/usr/include
 	# Link to libc and libstdc++ statically, because the arm64 shared
 	# libraries are not available on arm. In addition, disable sanitizers
 	# for 64-bit builds.
@@ -52,7 +50,7 @@
 		die "board_setup_64bit_au_env must be called first"
 
 	filter-ldflags -L"${__AU_OLD_SYSROOT}"/usr/lib64 -L"${SYSROOT}"/usr/lib64
-	filter-flags -isystem "${SYSROOT}"/usr/include
+	filter-flags -idirafter "${__AU_OLD_SYSROOT}"/usr/include
 	filter-flags -static -fno-sanitize=all
 	export SYSROOT=${__AU_OLD_SYSROOT}
 	export LIBDIR_arm64=${__AU_OLD_LIBDIR_arm64}
@@ -61,7 +59,6 @@
 	if [[ ${CC} == *"clang"* ]]; then
 		export CC=${__AU_OLD_CC}
 		export CXX=${__AU_OLD_CXX}
-		filter-flags "-Xclang-only=-stdlib=libstdc++"
 	fi
 	unset LIBCHROME_SYSROOT
 }
diff --git a/eclass/cros-i686.eclass b/eclass/cros-i686.eclass
index 90bbad8..a1ed5d5 100644
--- a/eclass/cros-i686.eclass
+++ b/eclass/cros-i686.eclass
@@ -31,17 +31,12 @@
 	if [[ ${CC} == *"clang"* ]]; then
 		export CC=${CHOST}-clang
 		export CXX=${CHOST}-clang++
-		append-flags "-Xclang-only=-stdlib=libstdc++"
-		append-ldflags "-Xclang-only=-stdlib=libstdc++"
-		# TODO(crbug.com/991024): Work around for lld not linking with 32bit
-		# glibc.
-		append-ldflags "-Xclang-only=-Wl,--allow-multiple-definition"
 	fi
 	__AU_OLD_SYSROOT=${SYSROOT}
 	export LIBCHROME_SYSROOT=${SYSROOT}
 	export SYSROOT=/usr/${CHOST}
 	append-ldflags -L"${__AU_OLD_SYSROOT}"/usr/lib
-	append-cppflags -isystem "${__AU_OLD_SYSROOT}"/usr/include
+	append-cppflags -idirafter "${__AU_OLD_SYSROOT}"/usr/include
 	# Link to libc and libstdc++ statically, because the i686 shared
 	# libraries are not available on x86_64. In addition, disable sanitizers
 	# for 32-bit builds.
@@ -57,7 +52,7 @@
 		die "board_setup_32bit_au_env must be called first"
 
 	filter-ldflags -L"${__AU_OLD_SYSROOT}"/usr/lib
-	filter-flags -isystem "${__AU_OLD_SYSROOT}"/usr/include
+	filter-flags -idirafter "${__AU_OLD_SYSROOT}"/usr/include
 	filter-flags -static -fno-sanitize=all
 	export SYSROOT=${__AU_OLD_SYSROOT}
 	export CHOST=${__AU_OLD_CHOST}
@@ -67,10 +62,6 @@
 	if [[ ${CC} == *"clang"* ]]; then
 		export CC=${__AU_OLD_CC}
 		export CXX=${__AU_OLD_CXX}
-		filter-flags "-Xclang-only=-stdlib=libstdc++"
-		# TODO(crbug.com/991024): Work around for lld not linking with 32bit
-		# glibc.
-		filter-flags "-Xclang-only=-Wl,--allow-multiple-definition"
 	fi
 	unset LIBCHROME_SYSROOT
 }