Hi Wookey,
I've attached an updated patchset - largely based on your patches, adjusted to fix the above issues, and includes a development makefile.dev that retains the original arch/dbg|rel directory structure, but allows the master makefile to have the single builddir needed for the Debian distro. Other than that it should be largely what you developed over the past couple of weeks. Should apply to 0.8.1
The final upstream patchset will contain additional stuff (some expanded user docs and a couple of source fixes that have been made since 0.8.1), but if you could check that this set doesn't break the packaging build, then we will be almost there.
Thanks
Mike
On 10 April 2018 at 18:18, Mike Leach mike.leach@linaro.org wrote:
Hi Wookey,
Not added the above yet as there doesn't appear to be an actual attached .patch file, and it does appear that the patch may remove the reliance on including DEPS - which I think is required to ensure that we only build changed files.
However, the previous patches break the build in two fundamental ways.
- running make from the build\linux directory results in awk failing
and thus the entire build failing
awk: cannot open /disk-2/mleach/opencsd-master/decoder/build/linux/decoder/include/ocsd_if_version.h (No such file or directory) awk: cannot open /disk-2/mleach/opencsd-master/decoder/build/linux/decoder/include/ocsd_if_version.h (No such file or directory) awk: cannot open /disk-2/mleach/opencsd-master/decoder/build/linux/decoder/include/ocsd_if_version.h (No such file or directory) cd /disk-2/mleach/opencsd-master/decoder/build/linux/decoder/build/linux/ref_trace_decode_lib && make clean /bin/sh: 1: cd: can't cd to /disk-2/mleach/opencsd-master/decoder/build/linux/decoder/build/linux/ref_trace_decode_lib
editing a single source file and rebuilding (without clean so that _only_ the changed files are altered) make results in an error:-
( cd /disk-2/mleach/opencsd-master/decoder/lib/builddir; ln -s libopencsd.so.0.8.3 libopencsd.so.0 ) ln: failed to create symbolic link 'libopencsd.so.0': File exists makefile:133: recipe for target '/disk-2/mleach/opencsd-master/decoder/lib/builddir/libopencsd.so.0' failed make[1]: *** [/disk-2/mleach/opencsd-master/decoder/lib/builddir/libopencsd.so.0] Error 1
The whole point of the dependencies etc.is to allow incremental build and development. Thus this has to be fixed.
These really need to be fixed before I can release a patchset to upstream - so any suggestions welcome.
Regards
Mike
On 8 April 2018 at 14:46, Wookey wookey@wookware.org wrote:
On 2018-04-05 07:50 +0000, Mike Leach wrote:
On 2018-03-22 02:59 +0000, Wookey wrote:
The .d problem:
My understanding is that because of the -MMD option the .d files should be built alongside the .o files as part of the compilation. Why might that not happen?
Not sure - that is my understanding too.
Not managed to reproduce this yet - but will revisit as soon as I get back from vacation (Mon 9th).
I had a proper peer at the entrails and eventually worked out how to reproduce this. It's the presence or otherwise of the decoder/build/linux/ref_trace_decode_lib/builddir build directory.
That needs to exist _before_ the first g++ command otherwise it fails, confusingly talking about the .d file it can't read, when really the problem is that it didn't _create_ it.
The fix is simple enough: add this dependency. This was an ommission from the rearangement of the dependcies in the sonames patch.
And it wasn't revealed (and thus much more obvious) because those two sub-builddirs weren't getting cleaned, so once they existed that source tree would always build.
This patch fixes both issues. Index: libopencsd-0.8.1/decoder/build/linux/rctdl_c_api_lib/makefile =================================================================== --- libopencsd-0.8.1.orig/decoder/build/linux/rctdl_c_api_lib/makefile +++ libopencsd-0.8.1/decoder/build/linux/rctdl_c_api_lib/makefile @@ -85,7 +85,7 @@ DEPS := $(OBJECTS:%.o=%.d) -include $(DEPS)
## object compile -$(BUILD_DIR)/%.o : %.cpp +$(BUILD_DIR)/%.o : %.cpp | $(BUILD_DIR) $(CXX) $(CXXFLAGS) $(CXX_INCLUDES) -MMD $< -o $@
@@ -96,6 +96,7 @@ clean: rm -f $(DEPS) rm -f $(LIB_TARGET_DIR)/$(LIB_NAME).a rm -f $(LIB_TARGET_DIR)/$(LIB_NAME).so*
-rmdir $(BUILD_DIR)
#### install the necessary include files for the c-api library on linux install_inc: Index: libopencsd-0.8.1/decoder/build/linux/ref_trace_decode_lib/makefile =================================================================== --- libopencsd-0.8.1.orig/decoder/build/linux/ref_trace_decode_lib/makefile +++ libopencsd-0.8.1/decoder/build/linux/ref_trace_decode_lib/makefile @@ -144,7 +144,7 @@ DEPS := $(OBJECTS:%.o=%.d) -include $(DEPS)
## object compile -$(BUILD_DIR)/%.o : %.cpp +$(BUILD_DIR)/%.o : %.cpp | $(BUILD_DIR) $(CXX) $(CXXFLAGS) $(CXX_INCLUDES) -MMD $< -o $@
@@ -155,3 +155,4 @@ clean: rm -f $(DEPS) rm -f $(LIB_TARGET_DIR)/$(LIB_NAME).a rm -f $(LIB_TARGET_DIR)/$(LIB_NAME).so*
-rmdir $(BUILD_DIR)
Wookey
Principal hats: Linaro, Debian, Wookware, ARM http://wookware.org/
CoreSight mailing list CoreSight@lists.linaro.org https://lists.linaro.org/mailman/listinfo/coresight
-- Mike Leach Principal Engineer, ARM Ltd. Blackburn Design Centre. UK