VirtualBox

Changeset 83223 in vbox for trunk/src/VBox/Main/webservice


Ignore:
Timestamp:
Mar 6, 2020 2:41:03 PM (5 years ago)
Author:
vboxsync
Message:

webservice: Strip inline functions from soapH.h and put them in separate C++ files to speed up compilation and avoid gcc 9.2+ internal compiler error. This avoid having to compile soapC.cpp in one go with gcc 9.2+ and waste ages waiting for that to complete (yeah, even with -O0 that takes forever).

Location:
trunk/src/VBox/Main/webservice
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/webservice/Makefile.kmk

    r83214 r83223  
    198198
    199199
    200 # GCC 9.2 doesn't cope well with the split files (internal error), so
    201 # don't do it there.
    202 if !defined(VBOX_WITHOUT_SPLIT_SOAPC) && !defined(VBOX_WITH_SPLIT_SOAPC) && $(VBOX_GCC_VERSION_CXX) >= 90200
    203  VBOX_WITHOUT_SPLIT_SOAPC := 1
     200# GCC 9.2 doesn't cope ver well with the split soapC.cpp files (internal error).
     201# Seemingly, the issue goes away when we strip inline functions from soapH.h.
     202ifdef VBOX_WITHOUT_NOINLINE_SOAPH
     203 if !defined(VBOX_WITHOUT_SPLIT_SOAPC) && !defined(VBOX_WITH_SPLIT_SOAPC) && $(VBOX_GCC_VERSION_CXX) >= 90200
     204  $(info Triggering VBOX_WITHOUT_SPLIT_SOAPC because of VBOX_GCC_VERSION_CXX=$(VBOX_GCC_VERSION_CXX) and VBOX_WITHOUT_NOINLINE_SOAPH)
     205  VBOX_WITHOUT_SPLIT_SOAPC := 1
     206 endif
    204207endif
    205208
     
    216219ifdef VBOX_GSOAP_INSTALLED
    217220 ifndef VBOX_ONLY_SDK
     221  #
     222  # soapC and soapH-noinline file splitter.
     223  #
     224  BLDPROGS += split-soapC
     225  split-soapC_TEMPLATE = VBoxBldProg
     226  split-soapC_SOURCES = split-soapC.cpp
     227
    218228  #
    219229  # vboxsoap - Library used by both the programs (save build time).
     
    230240  vboxsoap_CXXFLAGS.win += -wd4702 # soapc-4.cpp(16) : warning C4702: unreachable code
    231241  ifn1of ($(KBUILD_TARGET), win)
    232    vboxsoap_CXXFLAGS += -Wno-shadow -Wno-parentheses $(VBOX_GCC_Wno-literal-suffix) $(VBOX_GCC_Wno-stringop-overflow) $(VBOX_GCC_Wno-stringop-truncation)
     242   vboxsoap_CXXFLAGS += -Wno-shadow -Wno-parentheses $(VBOX_GCC_Wno-literal-suffix) \
     243        $(VBOX_GCC_Wno-stringop-overflow) $(VBOX_GCC_Wno-stringop-truncation) \
     244        $(VBOX_GCC_Wno-vla) -Wno-format -Wno-deprecated-declarations
    233245   ifn1of ($(KBUILD_TYPE), debug) # Save time+memory by using -O0 instead of -O2.
    234246    vboxsoap_CXXFLAGS += -O0 ## @todo this could be interesting for g++ (not clang++): -fcprop-registers
     
    247259        $(VBOXWEB_OUT_DIR)/soapC.cpp
    248260  else
    249    BLDPROGS += split-soapC
    250    split-soapC_TEMPLATE = VBoxBldProg
    251    split-soapC_SOURCES = split-soapC.cpp
    252 
    253261   vboxsoap_SOURCES = \
    254262        $(VBOXWEB_OUT_DIR)/soapC-1.cpp \
     
    281289        $(VBOXWEB_OUT_DIR)/soapC-28.cpp \
    282290        $(VBOXWEB_OUT_DIR)/soapC-29.cpp
    283   vboxsoap_CXXFLAGS += \
    284         $(VBOX_GCC_Wno-vla) \
    285         $(if-expr $(KBUILD_TARGET) == "win",,-Wno-format) \
    286         $(if-expr $(KBUILD_TARGET) == "win",,-Wno-deprecated-declarations)
     291  endif
     292  ifndef VBOX_WITHOUT_NOINLINE_SOAPH
     293   vboxsoap_SOURCES += \
     294        $(VBOXWEB_OUT_DIR)/soapH-noinline-1.cpp \
     295        $(VBOXWEB_OUT_DIR)/soapH-noinline-2.cpp \
     296        $(VBOXWEB_OUT_DIR)/soapH-noinline-3.cpp \
     297        $(VBOXWEB_OUT_DIR)/soapH-noinline-4.cpp \
     298        $(VBOXWEB_OUT_DIR)/soapH-noinline-5.cpp \
     299        $(VBOXWEB_OUT_DIR)/soapH-noinline-6.cpp \
     300        $(VBOXWEB_OUT_DIR)/soapH-noinline-7.cpp \
     301        $(VBOXWEB_OUT_DIR)/soapH-noinline-8.cpp \
     302        $(VBOXWEB_OUT_DIR)/soapH-noinline-9.cpp \
     303        $(VBOXWEB_OUT_DIR)/soapH-noinline-10.cpp \
     304        $(VBOXWEB_OUT_DIR)/soapH-noinline-11.cpp \
     305        $(VBOXWEB_OUT_DIR)/soapH-noinline-12.cpp
    287306  endif
    288307  vboxsoap_CLEAN := $(vboxsoap_SOURCES) # lazy bird
     
    302321   # Necessary with gcc 9.2.1 for some reason:
    303322   $(VBOX_GSOAP_CXX_SOURCES)_CXXFLAGS += -Wno-deprecated-declarations
    304 
    305 
    306323  endif
    307324
     
    770787## @todo change this to state explicitly what will be generated?
    771788
    772 # generate server and client code from gsoap pseudo-C header file
     789#
     790# Generate server and client code from gsoap pseudo-C header file.
     791#
     792# Options for soapcpp2:
     793#   -2: generate SOAP 1.2 calls
     794#   -L: don't generate soapClientLib/soapServerLib
     795#   -w: don't generate WSDL and schema files
     796#   -x: don't generate sample XML files (VBOXWEB_SOAPCPP2_SKIP_FILES).
     797#
    773798$(VBOXWEB_OUT_DIR)/gsoap_generate_all_ts \
    774799+ $(VBOXWEB_OUT_DIR)/soapH.h \
     800$(if-expr !defined(VBOX_WITHOUT_NOINLINE_SOAPH),\
     801+ $(VBOXWEB_OUT_DIR)/soapH-noinline-1.cpp \
     802+ $(VBOXWEB_OUT_DIR)/soapH-noinline-2.cpp \
     803+ $(VBOXWEB_OUT_DIR)/soapH-noinline-3.cpp \
     804+ $(VBOXWEB_OUT_DIR)/soapH-noinline-4.cpp \
     805+ $(VBOXWEB_OUT_DIR)/soapH-noinline-5.cpp \
     806+ $(VBOXWEB_OUT_DIR)/soapH-noinline-6.cpp \
     807+ $(VBOXWEB_OUT_DIR)/soapH-noinline-7.cpp \
     808+ $(VBOXWEB_OUT_DIR)/soapH-noinline-8.cpp \
     809+ $(VBOXWEB_OUT_DIR)/soapH-noinline-9.cpp \
     810+ $(VBOXWEB_OUT_DIR)/soapH-noinline-10.cpp \
     811+ $(VBOXWEB_OUT_DIR)/soapH-noinline-11.cpp \
     812+ $(VBOXWEB_OUT_DIR)/soapH-noinline-12.cpp,) \
    775813+ $(VBOXWEB_SOAP_CLIENT_H) \
    776814+ $(VBOXWEB_OUT_DIR)/soapC.cpp \
    777815+ $(VBOXWEB_OUT_DIR)/soapClient.cpp \
    778816+ $(VBOXWEB_OUT_DIR)/soapServer.cpp \
    779 : $(VBOXWEB_GSOAPH_FROM_GSOAP) $(VBOXWEB_GSOAPH_FROM_XSLT) $(VBOX_NSMAP) $(VBOX_PATH_WEBSERVICE)/stdsoap2.sed \
     817: $(VBOXWEB_GSOAPH_FROM_GSOAP) $(VBOXWEB_GSOAPH_FROM_XSLT) $(VBOX_NSMAP) \
     818                $(VBOX_PATH_WEBSERVICE)/stdsoap2.sed \
     819                $(VBOX_PATH_WEBSERVICE)/soap-header-to-inline-source-file.sed \
     820                $(VBOX_PATH_WEBSERVICE)/soap-header-strip-inline.sed \
     821                $$(split-soapC_1_TARGET) \
    780822                $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
    781823        $(call MSG_GENERATE,,lots of files,$(GSOAPH_RELEVANT))
     
    786828        $(SED) -f $(VBOX_PATH_WEBSERVICE)/stdsoap2.sed --output "$(VBOXWEB_SOAP_CLIENT_H)" "$(VBOXWEB_SOAP_CLIENT_H).tmp"
    787829        $(RM) -f "$(VBOXWEB_SOAP_CLIENT_H).tmp"
     830endif
     831ifndef VBOX_WITHOUT_NOINLINE_SOAPH
     832        $(MV) -f -- "$(VBOXWEB_OUT_DIR)/soapH.h" "$(VBOXWEB_OUT_DIR)/soapH.h.tmp"
     833        $(SED) -f $(VBOX_PATH_WEBSERVICE)/soap-header-to-inline-source-file.sed \
     834                --output "$(VBOXWEB_OUT_DIR)/soapH-noinline.cpp" \
     835                "$(VBOXWEB_OUT_DIR)/soapH.h.tmp"
     836        $(split-soapC_1_TARGET) $(VBOXWEB_OUT_DIR)/soapH-noinline.cpp $(VBOXWEB_OUT_DIR)/soapH-noinline- 12
     837        $(SED) -f $(VBOX_PATH_WEBSERVICE)/soap-header-strip-inline.sed \
     838                --output "$(VBOXWEB_OUT_DIR)/soapH.h" \
     839                "$(VBOXWEB_OUT_DIR)/soapH.h.tmp"
     840        $(RM) -f -- "$(VBOXWEB_OUT_DIR)/soapH.h.tmp" "$(VBOXWEB_OUT_DIR)/soapH-noinline.cpp"
    788841endif
    789842        $(APPEND) $@ done
     
    808861$(PATH_TARGET_SOAPDEMOHEADERS)/soapvboxBindingObject.h: $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts
    809862
    810 # soapcpp2 -2: generate SOAP 1.2 calls
    811 # soapcpp2 -S: server-side code only
    812 # soapcpp2 -L: don't generate soapClientLib/soapServerLib
    813 # soapcpp2 -w: don't generate WSDL and schema files
    814 # soapcpp2 -x: don't generate sample XML files
     863hack: $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts
    815864
    816865ifndef VBOX_WITHOUT_SPLIT_SOAPC
     
    850899: $(VBOXWEB_OUT_DIR)/soapC.cpp $$(split-soapC_1_TARGET) | $$(dir $$@)
    851900        $(RM) -f -- $(wildcard $(VBOXWEB_OUT_DIR)/soapC-?.cpp $(VBOXWEB_OUT_DIR)/soapC-??.cpp)
    852         $(split-soapC_1_TARGET) $(VBOXWEB_OUT_DIR)/soapC.cpp $(VBOXWEB_OUT_DIR) 29
     901        $(split-soapC_1_TARGET) $(VBOXWEB_OUT_DIR)/soapC.cpp $(VBOXWEB_OUT_DIR)/soapC- 29
    853902endif # !VBOX_WITHOUT_SPLIT_SOAPC
    854903
  • trunk/src/VBox/Main/webservice/split-soapC.cpp

    r82968 r83223  
     1/* $Id$ */
    12/** @file
    2  * File splitter: splits soapC.cpp into manageable pieces. It is somewhat
    3  * intelligent and avoids splitting inside functions or similar places.
     3 * Splits soapC.cpp and soapH-noinline.cpp into more manageable portions.
    44 */
    55
     
    1616 */
    1717
     18
     19/*********************************************************************************************************************************
     20*   Header Files                                                                                                                 *
     21*********************************************************************************************************************************/
    1822#include <iprt/types.h>
     23#include <iprt/path.h>
    1924#include <sys/types.h>
    2025#include <stdio.h>
     
    2429
    2530
    26 char *readfileIntoBuffer(const char *pszFile, size_t *pcbFile)
     31static char *readfileIntoBuffer(const char *pszFile, size_t *pcbFile)
    2732{
    2833    FILE *pFileIn = fopen(pszFile, "rb");
     
    6974    if (argc != 4)
    7075    {
    71         fprintf(stderr, "split-soapC: Must be started with exactly three arguments,\n"
    72                         "1) the input file, 2) the directory where to put the output files and\n"
    73                         "3) the number chunks to create.\n");
     76        fprintf(stderr, "split-soapC: Must be started with exactly four arguments,\n"
     77                        "1) the input file, 2) the output filename prefix and\n"
     78                        "3) the number chunks to create.");
    7479        return RTEXITCODE_SYNTAX;
    7580    }
     
    116121            /* construct output filename */
    117122            char szFilename[1024];
    118             sprintf(szFilename, "%s/soapC-%lu.cpp", argv[2], ++cFiles);
     123            sprintf(szFilename, "%s%lu.cpp", argv[2], ++cFiles);
    119124            szFilename[sizeof(szFilename)-1] = '\0';
    120             printf("info: soapC-%lu.cpp\n", cFiles);
     125
     126            size_t offName = strlen(szFilename);
     127            while (offName > 0 && !RTPATH_IS_SEP(szFilename[offName - 1]))
     128                offName -= 1;
     129            printf("info: %s\n", &szFilename[offName]);
    121130
    122131            /* create output file */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette