Skip to content

Commit

Permalink
Add support for new arch Loongarch
Browse files Browse the repository at this point in the history
  • Loading branch information
fangyaling committed Aug 25, 2023
1 parent 0965c76 commit 2e0db45
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
12 changes: 12 additions & 0 deletions nx-X11/config/cf/Imake.cf
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,18 @@ XCOMM Keep cpp from replacing path elements containing i486/i586/i686
# endif
# undef __sparc__
# endif
# if defined(__loongarch__)
# undef __loongarch__
# if __loongarch_grlen == 64
# undef __loongarch_grlen
# undef __loongarch_lp64
# define LoongArch64Architecture
# endif
# if __loongarch_grlen == 32
# undef __loongarch_grlen
# define LoongArch32Architecture
# endif
# endif
# ifdef ia64
# define ia64Architecture
# undef ia64
Expand Down
2 changes: 2 additions & 0 deletions nx-X11/config/cf/Imake.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,8 @@ XCOMM the platform-specific parameters - edit site.def to change
#define ByteOrder X_LITTLE_ENDIAN
#elif defined(SuperHebArchitecture)
#define ByteOrder X_BIG_ENDIAN
#elif defined(LoongArch64Architecture) || defined(LoongArch32Architecture)
#define ByteOrder X_LITTLE_ENDIAN
#endif
#endif /* ByteOrder */
X_BYTE_ORDER = ByteOrder
Expand Down
18 changes: 18 additions & 0 deletions nx-X11/config/cf/linux.cf
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,24 @@ XCOMM binutils: (LinuxBinUtilsMajorVersion)
# define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines -D_XSERVER64
#endif /* AMD64Architecture */

#ifdef LoongArch64Architecture
# ifndef OptimizedCDebugFlags
# define OptimizedCDebugFlags -O2 GccAliasingArgs
# endif
# define LinuxMachineDefines -D__loongarch__ -D__loongarch_grlen=64 -D__loongarch_lp64
# define ServerOSDefines XFree86ServerOSDefines
# define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines -D_XSERVER64
#endif /* LoongArch64Architecture */

#ifdef LoongArch32Architecture
# ifndef OptimizedCDebugFlags
# define OptimizedCDebugFlags -O2 GccAliasingArgs
# endif
# define LinuxMachineDefines -D__loongarch__ -D__loongarch_grlen=32
# define ServerOSDefines XFree86ServerOSDefines
# define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines
#endif /* LoongArch32Architecture */

#ifndef StandardDefines
# ifdef __linux__
# define StandardDefines -Dlinux LinuxMachineDefines LinuxSourceDefines
Expand Down

0 comments on commit 2e0db45

Please sign in to comment.