Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Add missing binding in SRCS
Browse files Browse the repository at this point in the history
Some files were not part of `mak/SRCS`, and thus were not compiled it.

Since they are C bindings, it was unnoticed for a long time,
as most operations won't require the rare symbols this module defined.
However for things such as static array declarations,
the `__init` of the struct might be required, which triggers a linker error.

One simple way to trigger the issue was to use the function `timersub` defined in
`core.sys.linux.sys.time`:

---
src/ocean/core/UnitTestRunner.d:671: undefined reference to 'core.sys.linux.sys.time.timersub(const(core.sys.posix.sys.time.timeval*), const(core.sys.posix.sys.time.timeval*), core.sys.posix.sys.time.timeval*)'
---

The change to win{32,64}.mak was mandatory as the toolchain on the auto-tester cannot cope with that
number of files, and errors with "Command too long". DMD support 'response file' for that purpose.
Using `*` is a DigitalMars MAKE extension which will pass commands > 996 chars via the env.
  • Loading branch information
Geod24 committed May 20, 2017
1 parent 6ae1682 commit 96c327e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 11 deletions.
1 change: 1 addition & 0 deletions mak/COPY
@@ -1,5 +1,6 @@
COPY=\
$(IMPDIR)\object.d \
\
$(IMPDIR)\core\atomic.d \
$(IMPDIR)\core\attribute.d \
$(IMPDIR)\core\bitop.d \
Expand Down
32 changes: 27 additions & 5 deletions mak/SRCS
Expand Up @@ -23,10 +23,15 @@ SRCS=\
src\core\internal\string.d \
src\core\internal\traits.d \
\
src\core\stdc\complex.d \
src\core\stdc\config.d \
src\core\stdc\ctype.d \
src\core\stdc\errno.d \
src\core\stdc\fenv.d \
src\core\stdc\float_.d \
src\core\stdc\inttypes.d \
src\core\stdc\limits.d \
src\core\stdc\locale.d \
src\core\stdc\math.d \
src\core\stdc\signal.d \
src\core\stdc\stdarg.d \
Expand All @@ -51,19 +56,36 @@ SRCS=\
\
src\core\sys\linux\stdio.d \
src\core\sys\linux\tipc.d \
src\core\sys\linux\sys\inotify.d \
src\core\sys\linux\sys\mman.d \
src\core\sys\linux\sys\signalfd.d \
src\core\sys\linux\sys\socket.d \
src\core\sys\linux\sys\sysinfo.d \
src\core\sys\linux\sys\time.d \
src\core\sys\linux\sys\xattr.d \
src\core\sys\linux\sys\netinet\tcp.d \
\
src\core\sys\posix\signal.d \
src\core\sys\posix\dirent.d \
src\core\sys\posix\signal.d \
src\core\sys\posix\netdb.d \
src\core\sys\posix\netinet\in_.d \
src\core\sys\posix\arpa\inet.d \
\
src\core\sys\posix\sys\ioctl.d \
src\core\sys\posix\sys\ipc.d \
src\core\sys\posix\sys\mman.d \
src\core\sys\posix\sys\resource.d \
src\core\sys\posix\sys\select.d \
src\core\sys\posix\sys\shm.d \
src\core\sys\posix\sys\socket.d \
src\core\sys\posix\sys\stat.d \
src\core\sys\posix\sys\statvfs.d \
src\core\sys\posix\sys\time.d \
src\core\sys\posix\sys\types.d \
src\core\sys\posix\sys\uio.d \
src\core\sys\posix\sys\un.d \
src\core\sys\posix\sys\wait.d \
src\core\sys\posix\netdb.d \
src\core\sys\posix\sys\ioctl.d \
src\core\sys\posix\sys\utsname.d \
src\core\sys\posix\netinet\in_.d \
src\core\sys\posix\arpa\inet.d \
\
src\core\sys\solaris\sys\priocntl.d \
src\core\sys\solaris\sys\types.d \
Expand Down
5 changes: 2 additions & 3 deletions win32.mak
Expand Up @@ -1281,10 +1281,10 @@ $(GCSTUB) : src\gcstub\gc.d win$(MODEL).mak
################### Library generation #########################

$(DRUNTIME): $(OBJS) $(SRCS) win$(MODEL).mak
$(DMD) -lib -of$(DRUNTIME) -Xfdruntime.json $(DFLAGS) $(SRCS) $(OBJS)
*$(DMD) -lib -of$(DRUNTIME) -Xfdruntime.json $(DFLAGS) $(SRCS) $(OBJS)

unittest : $(SRCS) $(DRUNTIME)
$(DMD) $(UDFLAGS) -L/co -unittest -ofunittest.exe -main $(SRCS) $(DRUNTIME) -debuglib=$(DRUNTIME) -defaultlib=$(DRUNTIME)
*$(DMD) $(UDFLAGS) -L/co -unittest -ofunittest.exe -main $(SRCS) $(DRUNTIME) -debuglib=$(DRUNTIME) -defaultlib=$(DRUNTIME)
unittest

zip: druntime.zip
Expand All @@ -1305,4 +1305,3 @@ clean:
auto-tester-build: target

auto-tester-test: unittest

5 changes: 2 additions & 3 deletions win64.mak
Expand Up @@ -1254,11 +1254,11 @@ $(GCSTUB) : src\gcstub\gc.d win64.mak
################### Library generation #########################

$(DRUNTIME): $(OBJS) $(SRCS) win64.mak
$(DMD) -lib -of$(DRUNTIME) -Xfdruntime.json $(DFLAGS) $(SRCS) $(OBJS)
*$(DMD) -lib -of$(DRUNTIME) -Xfdruntime.json $(DFLAGS) $(SRCS) $(OBJS)

# due to -conf= on the command line, LINKCMD and LIB need to be set in the environment
unittest : $(SRCS) $(DRUNTIME)
$(DMD) $(UDFLAGS) -version=druntime_unittest -unittest -ofunittest.exe -main $(SRCS) $(DRUNTIME) -debuglib=$(DRUNTIME) -defaultlib=$(DRUNTIME) user32.lib
*$(DMD) $(UDFLAGS) -version=druntime_unittest -unittest -ofunittest.exe -main $(SRCS) $(DRUNTIME) -debuglib=$(DRUNTIME) -defaultlib=$(DRUNTIME) user32.lib
unittest

################### Win32 COFF support #########################
Expand Down Expand Up @@ -1292,4 +1292,3 @@ clean:
auto-tester-build: target

auto-tester-test: unittest

0 comments on commit 96c327e

Please sign in to comment.