[build] Link with dl library on linux by default.

Otherwise executables simply does not link because C++ std lib we are
using has dependency on dl (through libunwind).

Fixes https://github.com/dart-lang/sdk/issues/35631

Note: this follows what newer versions of build configs do. See for
example one used in Flutter build root[1]

[1] https://github.com/flutter/buildroot/blob/224ebe0adaaf8463cc505a42c0e5eac870b2896e/build/config/BUILD.gn#L121

Change-Id: I405c820db4363a59230d7ba4f93d760a8cbbabc3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103627
Reviewed-by: Teagan Strickland <sstrickl@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index baa7bc3..f073da1 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -433,8 +433,10 @@
     ]
   }
 
-  # Android standard library setup.
-  if (is_android) {
+  if (is_linux) {
+    libs += [ "dl" ]
+  } else if (is_android) {
+    # Android standard library setup.
     if (is_clang) {
       # Work around incompatibilities between bionic and clang headers.
       defines += [ "__compiler_offsetof=__builtin_offsetof" ]