[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT PATCH v4 1/4] build: Introduce symbols exporting for each library



Hey Florian,

thanks for your review.

On 24.08.2018 14:12, Florian Schmidt wrote:
Hi Yuri, Simon,

thanks for the patch.

Reviewed-by: Florian Schmidt <florian.schmidt@xxxxxxxxx>

However, I have one small side remark (see below).

On 08/24/2018 01:11 PM, Simon Kuenzer wrote:
diff --git a/support/build/Makefile.rules b/support/build/Makefile.rules
index e317e3d..35e2921 100644
--- a/support/build/Makefile.rules
+++ b/support/build/Makefile.rules
@@ -419,9 +425,10 @@ $(call libname2preolib,$(1)): $($(call vprefix_lib,$(1),OBJS)) $($(call vprefix_                 $($(call vprefix_lib,$(1),OBJS)) $($(call vprefix_lib,$(1),OBJS-y)) \
                -o $(call libname2preolib,$(1)))
-$(call libname2olib,$(1)): $(call libname2preolib,$(1))
+$(call libname2olib,$(1)): $(call libname2preolib,$(1)) $(if $(wildcard $($(call vprefix_lib,$(1),EXPORTS))),$($(call vprefix_lib,$(1),EXPORTS)),)

This long if-condition in the dependencies of the rule seems a bit ugly. Now, it works, and I'm not an expert on makfiles, so I don't have a better option immediately, so I won't reject the patch; just wondering if there's anybody who has a better solution for this. Is there are way to encapsulate some of this stuff into function, so that the depends-line is a bit more compact?

The only option you would have is to introduce another Make function for doing this job. Saving and loading from a variable during the Make function never worked for me. I tend to do something like this (e.g., saving the result of the condition in a variable and refer to this one here). Unfortunately, it always ended up in a weird state when Make is processing the file. I guess it has to do with how Make does its processing but I am not a Make expert either. I am also happy to receive any suggestion about cleaning up this file from someone else. ;-)



      $(call build_cmd,OBJCOPY,,$(call libname2olib,$(1)),\
-        $(OBJCOPY) $(OBJCFLAGS) $(OBJCFLAGS-y) \
+        $(OBJCOPY) $(if $(wildcard $($(call vprefix_lib,$(1),EXPORTS))),--keep-global-symbols=$($(call vprefix_lib,$(1),EXPORTS)),) \

Same question as above.

Reason is the same as above.


+                   $(OBJCFLAGS) $(OBJCFLAGS-y) \
                     $($(call vprefix_lib,$(1),OBJCFLAGS)) $($(call vprefix_lib,$(1),OBJCFLAGS-y)) \
                 $(call libname2preolib,$(1)) $(call libname2olib,$(1)))






_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.