Hi @Rahul_Arora1 -
For MongoDB v4.4 and later, you can use the --separate-debug flag to automatically invoke objcopy to separate the debug symbols at build time. When you use this flag, new targets are enabled: along with the install-core target there will be an install-core-debug target which will install the separated debug files.
So I think your Command2 should more or less work. I think the compilation error you received with that command is due to the --spider-monkey-dbg=on flag, which you should not use. You also don’t need the --install-mode=hygienic flag since it is the default in v4.4
So, my recommended command line for you would be something like:
python3 buildscripts/scons.py DESTDIR=/opt/IBM/mongo-distro install-core --disable-warnings-as-errors --separate-debug=on
Note that that command won’t install the debug files. It is often a good idea to keep them around though. So, you might want to run:
python3 buildscripts/scons.py PREFIX=/opt/IBM/mongo-distro archive-core archive-core-debug --disable-warnings-as-errors --separate-debug=on
That will create archive files containing the runtime and debug symbols, respectively, which are packaged with the path /opt/IBM/mongo-distro (note the change from DESTDIR to PREFIX).
Thanks,
Andrew