Re: [Mesa-dev] [PATCH 6/7] mesa: build xmlconfig to a separate static library
On 11 June 2015 at 00:19, Matt Turner matts...@gmail.com wrote: On Wed, Jun 10, 2015 at 3:54 PM, Emil Velikov emil.l.veli...@gmail.com wrote: From: Erik Faye-Lund kusmab...@gmail.com As we use the file from both the dri modules and loader, we end up with multiple definition of the symbols provided in our gallium dri modules. Additionally we compile the file twice. Resolve both issues, effectively enabling the build on toolchains which don't support -Wl,--allow-multiple-definition. v2: [Emil Velikov] - Fix the Scons/Android build. - Resolve libgbm build issues (bring back the missing -lm) Cc: Julien Isorce j.iso...@samsung.com Cc: 10.5 10.6 mesa-sta...@lists.freedesktop.org Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90310 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90905 Signed-off-by: Emil Velikov emil.l.veli...@gmail.com --- src/gallium/targets/dri/Makefile.am | 6 -- src/loader/Makefile.am | 10 +++--- src/mesa/drivers/dri/Makefile.am | 1 + src/mesa/drivers/dri/common/Android.mk | 4 +++- src/mesa/drivers/dri/common/Makefile.am | 6 +- src/mesa/drivers/dri/common/Makefile.sources | 4 +++- src/mesa/drivers/dri/common/SConscript | 2 +- src/mesa/drivers/dri/i965/Makefile.am| 1 + 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/gallium/targets/dri/Makefile.am b/src/gallium/targets/dri/Makefile.am index f9e4ada..9648396 100644 --- a/src/gallium/targets/dri/Makefile.am +++ b/src/gallium/targets/dri/Makefile.am @@ -53,12 +53,6 @@ gallium_dri_la_LIBADD = \ $(LIBDRM_LIBS) \ $(GALLIUM_COMMON_LIB_DEPS) -# XXX: Temporary allow duplicated symbols, as the loader pulls in xmlconfig.c -# which already provides driParse* and driQuery* amongst others. -# Remove this hack as we come up with a cleaner solution. -gallium_dri_la_LDFLAGS += \ - -Wl,--allow-multiple-definition - EXTRA_gallium_dri_la_DEPENDENCIES = \ dri.sym \ $(top_srcdir)/src/gallium/targets/dri-vdpau.dyn diff --git a/src/loader/Makefile.am b/src/loader/Makefile.am index 36ddba8..aef1bd6 100644 --- a/src/loader/Makefile.am +++ b/src/loader/Makefile.am @@ -41,15 +41,11 @@ libloader_la_CPPFLAGS += \ -I$(top_builddir)/src/mesa/drivers/dri/common/ \ -I$(top_srcdir)/src/mesa/ \ -I$(top_srcdir)/src/mapi/ \ - -DUSE_DRICONF \ - $(EXPAT_CFLAGS) + -DUSE_DRICONF -libloader_la_SOURCES += \ - $(top_srcdir)/src/mesa/drivers/dri/common/xmlconfig.c + libloader_la_LIBADD += \ Looks like we have an extra leading space here. Do I understand correctly that after this patch the Gallium drivers will get their only copy of xmlconfig via linking against libloader.la? As Erik mentioned - you're bang on the spot. The alternative solutions did end up way messier/longer. Props to Erik for this approach ! -Emil ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 6/7] mesa: build xmlconfig to a separate static library
On Thu, Jun 11, 2015 at 1:19 AM, Matt Turner matts...@gmail.com wrote: On Wed, Jun 10, 2015 at 3:54 PM, Emil Velikov emil.l.veli...@gmail.com wrote: From: Erik Faye-Lund kusmab...@gmail.com As we use the file from both the dri modules and loader, we end up with multiple definition of the symbols provided in our gallium dri modules. Additionally we compile the file twice. Resolve both issues, effectively enabling the build on toolchains which don't support -Wl,--allow-multiple-definition. v2: [Emil Velikov] - Fix the Scons/Android build. - Resolve libgbm build issues (bring back the missing -lm) Cc: Julien Isorce j.iso...@samsung.com Cc: 10.5 10.6 mesa-sta...@lists.freedesktop.org Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90310 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90905 Signed-off-by: Emil Velikov emil.l.veli...@gmail.com --- src/gallium/targets/dri/Makefile.am | 6 -- src/loader/Makefile.am | 10 +++--- src/mesa/drivers/dri/Makefile.am | 1 + src/mesa/drivers/dri/common/Android.mk | 4 +++- src/mesa/drivers/dri/common/Makefile.am | 6 +- src/mesa/drivers/dri/common/Makefile.sources | 4 +++- src/mesa/drivers/dri/common/SConscript | 2 +- src/mesa/drivers/dri/i965/Makefile.am| 1 + 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/gallium/targets/dri/Makefile.am b/src/gallium/targets/dri/Makefile.am index f9e4ada..9648396 100644 --- a/src/gallium/targets/dri/Makefile.am +++ b/src/gallium/targets/dri/Makefile.am @@ -53,12 +53,6 @@ gallium_dri_la_LIBADD = \ $(LIBDRM_LIBS) \ $(GALLIUM_COMMON_LIB_DEPS) -# XXX: Temporary allow duplicated symbols, as the loader pulls in xmlconfig.c -# which already provides driParse* and driQuery* amongst others. -# Remove this hack as we come up with a cleaner solution. -gallium_dri_la_LDFLAGS += \ - -Wl,--allow-multiple-definition - EXTRA_gallium_dri_la_DEPENDENCIES = \ dri.sym \ $(top_srcdir)/src/gallium/targets/dri-vdpau.dyn diff --git a/src/loader/Makefile.am b/src/loader/Makefile.am index 36ddba8..aef1bd6 100644 --- a/src/loader/Makefile.am +++ b/src/loader/Makefile.am @@ -41,15 +41,11 @@ libloader_la_CPPFLAGS += \ -I$(top_builddir)/src/mesa/drivers/dri/common/ \ -I$(top_srcdir)/src/mesa/ \ -I$(top_srcdir)/src/mapi/ \ - -DUSE_DRICONF \ - $(EXPAT_CFLAGS) + -DUSE_DRICONF -libloader_la_SOURCES += \ - $(top_srcdir)/src/mesa/drivers/dri/common/xmlconfig.c + libloader_la_LIBADD += \ Looks like we have an extra leading space here. Do I understand correctly that after this patch the Gallium drivers will get their only copy of xmlconfig via linking against libloader.la? If that's correct, Acked-by: Matt Turner matts...@gmail.com That was the intention, yeah. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 6/7] mesa: build xmlconfig to a separate static library
From: Erik Faye-Lund kusmab...@gmail.com As we use the file from both the dri modules and loader, we end up with multiple definition of the symbols provided in our gallium dri modules. Additionally we compile the file twice. Resolve both issues, effectively enabling the build on toolchains which don't support -Wl,--allow-multiple-definition. v2: [Emil Velikov] - Fix the Scons/Android build. - Resolve libgbm build issues (bring back the missing -lm) Cc: Julien Isorce j.iso...@samsung.com Cc: 10.5 10.6 mesa-sta...@lists.freedesktop.org Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90310 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90905 Signed-off-by: Emil Velikov emil.l.veli...@gmail.com --- src/gallium/targets/dri/Makefile.am | 6 -- src/loader/Makefile.am | 10 +++--- src/mesa/drivers/dri/Makefile.am | 1 + src/mesa/drivers/dri/common/Android.mk | 4 +++- src/mesa/drivers/dri/common/Makefile.am | 6 +- src/mesa/drivers/dri/common/Makefile.sources | 4 +++- src/mesa/drivers/dri/common/SConscript | 2 +- src/mesa/drivers/dri/i965/Makefile.am| 1 + 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/gallium/targets/dri/Makefile.am b/src/gallium/targets/dri/Makefile.am index f9e4ada..9648396 100644 --- a/src/gallium/targets/dri/Makefile.am +++ b/src/gallium/targets/dri/Makefile.am @@ -53,12 +53,6 @@ gallium_dri_la_LIBADD = \ $(LIBDRM_LIBS) \ $(GALLIUM_COMMON_LIB_DEPS) -# XXX: Temporary allow duplicated symbols, as the loader pulls in xmlconfig.c -# which already provides driParse* and driQuery* amongst others. -# Remove this hack as we come up with a cleaner solution. -gallium_dri_la_LDFLAGS += \ - -Wl,--allow-multiple-definition - EXTRA_gallium_dri_la_DEPENDENCIES = \ dri.sym \ $(top_srcdir)/src/gallium/targets/dri-vdpau.dyn diff --git a/src/loader/Makefile.am b/src/loader/Makefile.am index 36ddba8..aef1bd6 100644 --- a/src/loader/Makefile.am +++ b/src/loader/Makefile.am @@ -41,15 +41,11 @@ libloader_la_CPPFLAGS += \ -I$(top_builddir)/src/mesa/drivers/dri/common/ \ -I$(top_srcdir)/src/mesa/ \ -I$(top_srcdir)/src/mapi/ \ - -DUSE_DRICONF \ - $(EXPAT_CFLAGS) + -DUSE_DRICONF -libloader_la_SOURCES += \ - $(top_srcdir)/src/mesa/drivers/dri/common/xmlconfig.c + libloader_la_LIBADD += \ + $(top_builddir)/src/mesa/drivers/dri/common/libxmlconfig.la -libloader_la_LIBADD += \ - -lm \ - $(EXPAT_LIBS) endif if !HAVE_LIBDRM diff --git a/src/mesa/drivers/dri/Makefile.am b/src/mesa/drivers/dri/Makefile.am index fa1de10..08a8e64 100644 --- a/src/mesa/drivers/dri/Makefile.am +++ b/src/mesa/drivers/dri/Makefile.am @@ -60,6 +60,7 @@ mesa_dri_drivers_la_LIBADD = \ ../../libmesa.la \ common/libmegadriver_stub.la \ common/libdricommon.la \ +common/libxmlconfig.la \ $(MEGADRIVERS_DEPS) \ $(DRI_LIB_DEPS) \ $() diff --git a/src/mesa/drivers/dri/common/Android.mk b/src/mesa/drivers/dri/common/Android.mk index c003c94..6986f5e 100644 --- a/src/mesa/drivers/dri/common/Android.mk +++ b/src/mesa/drivers/dri/common/Android.mk @@ -50,7 +50,9 @@ else LOCAL_SHARED_LIBRARIES := libdrm endif -LOCAL_SRC_FILES := $(DRI_COMMON_FILES) +LOCAL_SRC_FILES := \ + $(DRI_COMMON_FILES) \ + $(XMLCONFIG_FILES) MESA_DRI_OPTIONS_H := $(intermediates)/xmlpool/options.h LOCAL_GENERATED_SOURCES := $(MESA_DRI_OPTIONS_H) diff --git a/src/mesa/drivers/dri/common/Makefile.am b/src/mesa/drivers/dri/common/Makefile.am index da8f97a..ae19fcb 100644 --- a/src/mesa/drivers/dri/common/Makefile.am +++ b/src/mesa/drivers/dri/common/Makefile.am @@ -33,16 +33,20 @@ AM_CFLAGS = \ -I$(top_srcdir)/src/gallium/include \ -I$(top_srcdir)/src/gallium/auxiliary \ $(DEFINES) \ - $(EXPAT_CFLAGS) \ $(VISIBILITY_CFLAGS) noinst_LTLIBRARIES = \ libdricommon.la \ + libxmlconfig.la \ libmegadriver_stub.la \ libdri_test_stubs.la libdricommon_la_SOURCES = $(DRI_COMMON_FILES) +libxmlconfig_la_SOURCES = $(XMLCONFIG_FILES) +libxmlconfig_la_CFLAGS = $(AM_CFLAGS) $(EXPAT_CFLAGS) +libxmlconfig_la_LIBADD = $(EXPAT_LIBS) -lm + libdri_test_stubs_la_SOURCES = $(test_stubs_FILES) libdri_test_stubs_la_CFLAGS = $(AM_CFLAGS) -DNO_MAIN diff --git a/src/mesa/drivers/dri/common/Makefile.sources b/src/mesa/drivers/dri/common/Makefile.sources index d00ec5f..d5d8da8 100644 --- a/src/mesa/drivers/dri/common/Makefile.sources +++ b/src/mesa/drivers/dri/common/Makefile.sources @@ -2,7 +2,9 @@ DRI_COMMON_FILES := \ utils.c \ utils.h \ dri_util.c \ - dri_util.h \ + dri_util.h + +XMLCONFIG_FILES := \ xmlconfig.c \ xmlconfig.h diff --git a/src/mesa/drivers/dri/common/SConscript b/src/mesa/drivers/dri/common/SConscript index 0bee1b4..b402736 100644 ---
Re: [Mesa-dev] [PATCH 6/7] mesa: build xmlconfig to a separate static library
On Wed, Jun 10, 2015 at 3:54 PM, Emil Velikov emil.l.veli...@gmail.com wrote: From: Erik Faye-Lund kusmab...@gmail.com As we use the file from both the dri modules and loader, we end up with multiple definition of the symbols provided in our gallium dri modules. Additionally we compile the file twice. Resolve both issues, effectively enabling the build on toolchains which don't support -Wl,--allow-multiple-definition. v2: [Emil Velikov] - Fix the Scons/Android build. - Resolve libgbm build issues (bring back the missing -lm) Cc: Julien Isorce j.iso...@samsung.com Cc: 10.5 10.6 mesa-sta...@lists.freedesktop.org Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90310 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90905 Signed-off-by: Emil Velikov emil.l.veli...@gmail.com --- src/gallium/targets/dri/Makefile.am | 6 -- src/loader/Makefile.am | 10 +++--- src/mesa/drivers/dri/Makefile.am | 1 + src/mesa/drivers/dri/common/Android.mk | 4 +++- src/mesa/drivers/dri/common/Makefile.am | 6 +- src/mesa/drivers/dri/common/Makefile.sources | 4 +++- src/mesa/drivers/dri/common/SConscript | 2 +- src/mesa/drivers/dri/i965/Makefile.am| 1 + 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/gallium/targets/dri/Makefile.am b/src/gallium/targets/dri/Makefile.am index f9e4ada..9648396 100644 --- a/src/gallium/targets/dri/Makefile.am +++ b/src/gallium/targets/dri/Makefile.am @@ -53,12 +53,6 @@ gallium_dri_la_LIBADD = \ $(LIBDRM_LIBS) \ $(GALLIUM_COMMON_LIB_DEPS) -# XXX: Temporary allow duplicated symbols, as the loader pulls in xmlconfig.c -# which already provides driParse* and driQuery* amongst others. -# Remove this hack as we come up with a cleaner solution. -gallium_dri_la_LDFLAGS += \ - -Wl,--allow-multiple-definition - EXTRA_gallium_dri_la_DEPENDENCIES = \ dri.sym \ $(top_srcdir)/src/gallium/targets/dri-vdpau.dyn diff --git a/src/loader/Makefile.am b/src/loader/Makefile.am index 36ddba8..aef1bd6 100644 --- a/src/loader/Makefile.am +++ b/src/loader/Makefile.am @@ -41,15 +41,11 @@ libloader_la_CPPFLAGS += \ -I$(top_builddir)/src/mesa/drivers/dri/common/ \ -I$(top_srcdir)/src/mesa/ \ -I$(top_srcdir)/src/mapi/ \ - -DUSE_DRICONF \ - $(EXPAT_CFLAGS) + -DUSE_DRICONF -libloader_la_SOURCES += \ - $(top_srcdir)/src/mesa/drivers/dri/common/xmlconfig.c + libloader_la_LIBADD += \ Looks like we have an extra leading space here. Do I understand correctly that after this patch the Gallium drivers will get their only copy of xmlconfig via linking against libloader.la? If that's correct, Acked-by: Matt Turner matts...@gmail.com + $(top_builddir)/src/mesa/drivers/dri/common/libxmlconfig.la -libloader_la_LIBADD += \ - -lm \ - $(EXPAT_LIBS) endif if !HAVE_LIBDRM ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev