Skip to content

Commit

Permalink
Prevented the linker from choking on Solaris because of a static libr…
Browse files Browse the repository at this point in the history
…ary with no symbols
  • Loading branch information
Eric Botcazou committed Oct 18, 2002
1 parent e41da40 commit f7dbb9e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions makefile.lst
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ ALLEGRO_SRC_UNIX_FILES = \
src/unix/arts.c \
src/unix/udjgpp.c \
src/unix/udrvlist.c \
src/unix/udummy.c \
src/unix/uesd.c \
src/unix/ufile.c \
src/unix/ugfxdrv.c \
Expand Down
3 changes: 3 additions & 0 deletions misc/deplib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ write_code() {
}


# See src/unix/udummy.c for the rationale
sources=`echo $* | sed 's,[^ ]*/,,g'`
sharable_sources=`echo $sources | sed 's,[^. ]*\.s,,g'`
sharable_sources=`echo $sharable_sources | sed 's,[ ]*udummy\.c,,g'`
unsharable_sources=`echo $sources | sed 's,[^. ]*\.[^s],,g'`
unsharable_sources=`echo $unsharable_sources udummy.c`

objects=`echo $sources | sed 's,\.[^. ]*,,g'`
sharable_objects=`echo $sharable_sources | sed 's,\.[^. ]*,,g'`
Expand Down
8 changes: 8 additions & 0 deletions src/unix/udummy.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* This file contains a dummy symbol that gets unconditionally included
* in liballeg_unsharable.a through a tweak in misc/deplib.sh, in order
* to make sure that the static library contains at least one symbol.
* This is needed for Solaris because the linker chokes when a library
* contains no symbol.
*/

int _dummy_symbol;

0 comments on commit f7dbb9e

Please sign in to comment.