From: Tormod V. <lis...@gm...> - 2009-04-29 22:39:45
|
From: Tormod Volden <deb...@gm...> Prepend "-Wl," to linking options and let mklib ignore -Wl options inside the object list when building static libraries --- bin/mklib | 12 ++++++++++++ src/gallium/winsys/egl_xlib/Makefile | 2 +- src/gallium/winsys/xlib/Makefile | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/bin/mklib b/bin/mklib index a3e826a..47a2ebc 100755 --- a/bin/mklib +++ b/bin/mklib @@ -175,6 +175,18 @@ if [ ${ARCH} = "auto" ] ; then ARCH=`uname` fi +if [ $STATIC = 1 ]; then + # filter out linker options inside object list + NEWOBJECTS="" + for OBJ in $OBJECTS ; do + if [ `expr match $OBJ '-Wl,.*'` -gt 0 ]; then + echo "mklib: warning: ignoring $OBJ for static library" + else + NEWOBJECTS="$NEWOBJECTS $OBJ" + fi + done + OBJECTS=$NEWOBJECTS +fi # # Error checking diff --git a/src/gallium/winsys/egl_xlib/Makefile b/src/gallium/winsys/egl_xlib/Makefile index 02ac47c..8646ee3 100644 --- a/src/gallium/winsys/egl_xlib/Makefile +++ b/src/gallium/winsys/egl_xlib/Makefile @@ -60,7 +60,7 @@ $(TOP)/$(LIB_DIR)/$(DRIVER_NAME): $(WINSYS_OBJECTS) $(LIBS) -noprefix \ -install $(TOP)/$(LIB_DIR) \ $(MKLIB_OPTIONS) $(WINSYS_OBJECTS) \ - --whole-archive $(LIBS) --no-whole-archive + -Wl,--whole-archive $(LIBS) -Wl,--no-whole-archive depend: $(ALL_SOURCES) diff --git a/src/gallium/winsys/xlib/Makefile b/src/gallium/winsys/xlib/Makefile index bb187cc..04309e6 100644 --- a/src/gallium/winsys/xlib/Makefile +++ b/src/gallium/winsys/xlib/Makefile @@ -74,7 +74,7 @@ $(TOP)/$(LIB_DIR)/gallium/$(GL_LIB_NAME): $(XLIB_WINSYS_OBJECTS) $(LIBS) Makefil -major $(GL_MAJOR) -minor $(GL_MINOR) -patch $(GL_TINY) \ -install $(TOP)/$(LIB_DIR)/gallium \ $(MKLIB_OPTIONS) $(XLIB_WINSYS_OBJECTS) \ - --start-group $(LIBS) --end-group $(GL_LIB_DEPS) + -Wl,--start-group $(LIBS) -Wl,--end-group $(GL_LIB_DEPS) depend: $(XLIB_WINSYS_SOURCES) -- 1.6.0.4 |
From: Dan N. <dbn...@gm...> - 2009-04-29 23:33:47
|
On Wed, Apr 29, 2009 at 3:39 PM, Tormod Volden <lis...@gm...> wrote: > From: Tormod Volden <deb...@gm...> > > Prepend "-Wl," to linking options and let mklib ignore -Wl options > inside the object list when building static libraries > --- > bin/mklib | 12 ++++++++++++ > src/gallium/winsys/egl_xlib/Makefile | 2 +- > src/gallium/winsys/xlib/Makefile | 2 +- > 3 files changed, 14 insertions(+), 2 deletions(-) > > diff --git a/bin/mklib b/bin/mklib > index a3e826a..47a2ebc 100755 > --- a/bin/mklib > +++ b/bin/mklib > @@ -175,6 +175,18 @@ if [ ${ARCH} = "auto" ] ; then > ARCH=`uname` > fi > > +if [ $STATIC = 1 ]; then > + # filter out linker options inside object list > + NEWOBJECTS="" > + for OBJ in $OBJECTS ; do > + if [ `expr match $OBJ '-Wl,.*'` -gt 0 ]; then > + echo "mklib: warning: ignoring $OBJ for static library" > + else > + NEWOBJECTS="$NEWOBJECTS $OBJ" > + fi > + done > + OBJECTS=$NEWOBJECTS > +fi Is there any reason not to just use a case statement instead of forking expr? > > # > # Error checking > diff --git a/src/gallium/winsys/egl_xlib/Makefile b/src/gallium/winsys/egl_xlib/Makefile > index 02ac47c..8646ee3 100644 > --- a/src/gallium/winsys/egl_xlib/Makefile > +++ b/src/gallium/winsys/egl_xlib/Makefile > @@ -60,7 +60,7 @@ $(TOP)/$(LIB_DIR)/$(DRIVER_NAME): $(WINSYS_OBJECTS) $(LIBS) > -noprefix \ > -install $(TOP)/$(LIB_DIR) \ > $(MKLIB_OPTIONS) $(WINSYS_OBJECTS) \ > - --whole-archive $(LIBS) --no-whole-archive > + -Wl,--whole-archive $(LIBS) -Wl,--no-whole-archive > > > depend: $(ALL_SOURCES) > diff --git a/src/gallium/winsys/xlib/Makefile b/src/gallium/winsys/xlib/Makefile > index bb187cc..04309e6 100644 > --- a/src/gallium/winsys/xlib/Makefile > +++ b/src/gallium/winsys/xlib/Makefile > @@ -74,7 +74,7 @@ $(TOP)/$(LIB_DIR)/gallium/$(GL_LIB_NAME): $(XLIB_WINSYS_OBJECTS) $(LIBS) Makefil > -major $(GL_MAJOR) -minor $(GL_MINOR) -patch $(GL_TINY) \ > -install $(TOP)/$(LIB_DIR)/gallium \ > $(MKLIB_OPTIONS) $(XLIB_WINSYS_OBJECTS) \ > - --start-group $(LIBS) --end-group $(GL_LIB_DEPS) > + -Wl,--start-group $(LIBS) -Wl,--end-group $(GL_LIB_DEPS) > > > depend: $(XLIB_WINSYS_SOURCES) Thanks for fixing these. -- Dan |
From: Tormod V. <lis...@gm...> - 2009-04-30 06:37:40
|
From: Tormod Volden <deb...@gm...> Dan Nicholson wrote: > Is there any reason not to just use a case statement instead of forking expr? No, that was just copied from another part of the script. Tormod --- Prepend "-Wl," to linking options and let mklib ignore -Wl options inside the object list when building static libraries Signed-off-by: Tormod Volden <deb...@gm...> --- bin/mklib | 15 +++++++++++++++ src/gallium/winsys/egl_xlib/Makefile | 2 +- src/gallium/winsys/xlib/Makefile | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/bin/mklib b/bin/mklib index a3e826a..86aa80f 100755 --- a/bin/mklib +++ b/bin/mklib @@ -175,6 +175,21 @@ if [ ${ARCH} = "auto" ] ; then ARCH=`uname` fi +if [ $STATIC = 1 ]; then + # filter out linker options inside object list + NEWOBJECTS="" + for OBJ in $OBJECTS ; do + case $OBJ in + -Wl,*) + echo "mklib: warning: ignoring $OBJ for static library" + ;; + *) + NEWOBJECTS="$NEWOBJECTS $OBJ" + ;; + esac + done + OBJECTS=$NEWOBJECTS +fi # # Error checking diff --git a/src/gallium/winsys/egl_xlib/Makefile b/src/gallium/winsys/egl_xlib/Makefile index 02ac47c..8646ee3 100644 --- a/src/gallium/winsys/egl_xlib/Makefile +++ b/src/gallium/winsys/egl_xlib/Makefile @@ -60,7 +60,7 @@ $(TOP)/$(LIB_DIR)/$(DRIVER_NAME): $(WINSYS_OBJECTS) $(LIBS) -noprefix \ -install $(TOP)/$(LIB_DIR) \ $(MKLIB_OPTIONS) $(WINSYS_OBJECTS) \ - --whole-archive $(LIBS) --no-whole-archive + -Wl,--whole-archive $(LIBS) -Wl,--no-whole-archive depend: $(ALL_SOURCES) diff --git a/src/gallium/winsys/xlib/Makefile b/src/gallium/winsys/xlib/Makefile index bb187cc..04309e6 100644 --- a/src/gallium/winsys/xlib/Makefile +++ b/src/gallium/winsys/xlib/Makefile @@ -74,7 +74,7 @@ $(TOP)/$(LIB_DIR)/gallium/$(GL_LIB_NAME): $(XLIB_WINSYS_OBJECTS) $(LIBS) Makefil -major $(GL_MAJOR) -minor $(GL_MINOR) -patch $(GL_TINY) \ -install $(TOP)/$(LIB_DIR)/gallium \ $(MKLIB_OPTIONS) $(XLIB_WINSYS_OBJECTS) \ - --start-group $(LIBS) --end-group $(GL_LIB_DEPS) + -Wl,--start-group $(LIBS) -Wl,--end-group $(GL_LIB_DEPS) depend: $(XLIB_WINSYS_SOURCES) -- 1.6.0.4 |
From: Tormod V. <lis...@gm...> - 2009-04-30 19:49:36
|
From: Tormod Volden <deb...@gm...> Saves forking an expr for every object. Signed-off-by: Tormod Volden <deb...@gm...> --- On Thu, Apr 30, 2009 at 8:37 AM, Tormod Volden wrote: > Dan Nicholson wrote: >> Is there any reason not to just use a case statement instead of forking expr? > > No, that was just copied from another part of the script. And to save the trees, here is an additional patch to fix the part I had copied from. Cheers, Tormod -- bin/mklib | 27 +++++++++++++++------------ 1 files changed, 15 insertions(+), 12 deletions(-) diff --git a/bin/mklib b/bin/mklib index 86aa80f..6331f5a 100755 --- a/bin/mklib +++ b/bin/mklib @@ -279,18 +279,21 @@ case $ARCH in # expand any .a objects into constituent .o files. NEWOBJECTS="" DELETIA="" - for OBJ in ${OBJECTS} ; do - if [ `expr match $OBJ '.*\.a'` -gt 0 ] ; then - # extract the .o files from this .a archive - FILES=`ar t $OBJ` - ar x $OBJ - NEWOBJECTS="$NEWOBJECTS $FILES" - # keep track of temporary .o files and delete them below - DELETIA="$DELETIA $FILES" - else - # ordinary .o file - NEWOBJECTS="$NEWOBJECTS $OBJ" - fi + for OBJ in $OBJECTS ; do + case $OBJ in + *.a) + # extract the .o files from this .a archive + FILES=`ar t $OBJ` + ar x $OBJ + NEWOBJECTS="$NEWOBJECTS $FILES" + # keep track of temporary .o files and delete them below + DELETIA="$DELETIA $FILES" + ;; + *) + # ordinary .o file + NEWOBJECTS="$NEWOBJECTS $OBJ" + ;; + esac done # make lib -- 1.6.0.4 |
From: Brian P. <br...@vm...> - 2009-04-30 22:57:56
|
Thanks. I'll commit this and your prev patch after a bit more testing... -Brian Tormod Volden wrote: > From: Tormod Volden <deb...@gm...> > > Saves forking an expr for every object. > > Signed-off-by: Tormod Volden <deb...@gm...> > --- > > On Thu, Apr 30, 2009 at 8:37 AM, Tormod Volden wrote: >> Dan Nicholson wrote: >>> Is there any reason not to just use a case statement instead of forking expr? >> No, that was just copied from another part of the script. > > And to save the trees, here is an additional patch to fix the part I had copied from. > > Cheers, > Tormod > > -- > > bin/mklib | 27 +++++++++++++++------------ > 1 files changed, 15 insertions(+), 12 deletions(-) > > diff --git a/bin/mklib b/bin/mklib > index 86aa80f..6331f5a 100755 > --- a/bin/mklib > +++ b/bin/mklib > @@ -279,18 +279,21 @@ case $ARCH in > # expand any .a objects into constituent .o files. > NEWOBJECTS="" > DELETIA="" > - for OBJ in ${OBJECTS} ; do > - if [ `expr match $OBJ '.*\.a'` -gt 0 ] ; then > - # extract the .o files from this .a archive > - FILES=`ar t $OBJ` > - ar x $OBJ > - NEWOBJECTS="$NEWOBJECTS $FILES" > - # keep track of temporary .o files and delete them below > - DELETIA="$DELETIA $FILES" > - else > - # ordinary .o file > - NEWOBJECTS="$NEWOBJECTS $OBJ" > - fi > + for OBJ in $OBJECTS ; do > + case $OBJ in > + *.a) > + # extract the .o files from this .a archive > + FILES=`ar t $OBJ` > + ar x $OBJ > + NEWOBJECTS="$NEWOBJECTS $FILES" > + # keep track of temporary .o files and delete them below > + DELETIA="$DELETIA $FILES" > + ;; > + *) > + # ordinary .o file > + NEWOBJECTS="$NEWOBJECTS $OBJ" > + ;; > + esac > done > > # make lib |
From: Dan N. <dbn...@gm...> - 2009-04-30 23:08:43
|
On Thu, Apr 30, 2009 at 3:57 PM, Brian Paul <br...@vm...> wrote: > Thanks. I'll commit this and your prev patch after a bit more testing... I have the other one queued up, I just didn't have time to give it a spin yet. If you can wait until tomorrow (later tonight actually), I'll push them. But if you're in a rush, I think they're safe to commit. -- Dan |
From: Brian P. <br...@vm...> - 2009-04-30 23:19:15
|
Dan Nicholson wrote: > On Thu, Apr 30, 2009 at 3:57 PM, Brian Paul <br...@vm...> wrote: >> Thanks. I'll commit this and your prev patch after a bit more testing... > > I have the other one queued up, I just didn't have time to give it a > spin yet. If you can wait until tomorrow (later tonight actually), > I'll push them. But if you're in a rush, I think they're safe to > commit. I found a few glitches with the static linux build but everything else seems OK. -Brian |