[PR,d/87866] Committed redefine realpath as lrealpath in dmd front-end

Message ID CABOHX+ciPtD44vKa8dwNjUPWic_eYa+gaX97nLtQ8P7gVpVrxA@mail.gmail.com
State New
Headers show
Series
  • [PR,d/87866] Committed redefine realpath as lrealpath in dmd front-end
Related show

Commit Message

Iain Buclaw March 12, 2019, 4:32 p.m.
Hi,

This patch is a second fix for PR d/87866, as dmd front-end function
FileName::canonicalName could be called during the semantic pass of
import("file") expressions, so still requires that realpath() be
redefined.

Bootstrapped and ran D2 testsuite on x86_64-linux-gnu.

Committed to trunk as r269619.

-- 
Iain
---
gcc/d/ChangeLog:

2019-03-12  Iain Buclaw  <ibuclaw@gdcproject.org>

        PR d/87866
        * d-system.h (realpath): Redefine as lrealpath.

---

Patch

diff --git a/gcc/d/d-system.h b/gcc/d/d-system.h
index c32825d4ad1..efece15f3bc 100644
--- a/gcc/d/d-system.h
+++ b/gcc/d/d-system.h
@@ -31,6 +31,10 @@ 
 #undef assert
 #define assert(EXPR) gcc_assert(EXPR)
 
+/* Use libiberty's lrealpath to avoid portability problems.  */
+#undef realpath
+#define realpath(a, b) lrealpath((a))
+
 /* Forward ctype.h macros used by the dmd front-end to safe-ctype.h.  */
 #undef isalpha
 #define isalpha(c) ISALPHA(c)