Whether executables compiled with llvm can be disassembled into bc files? - clang

As mentioned in the question, for large programs, compile to executable files first. But I want to get its bc file, how do I implement the conversion? Or is it possible to get the bc file directly when compiling the full project?

Related

dxGDIPlusClasses.pas not found error delphi 10

When I tried to compile one of my BPL files, I get an error:
dxGDIPlusClasses.pas not found.
I double checked the unit file exists on the hard drive.
I also added $(BDSCOMMONDIR)\Dcp to the DCP Output directory, and $(BDSCOMMONDIR)\Bpl to the Package Output directory. The runtime package containing the unit was also added to the BPL.
I searched online for answers, foound one suggestion to enable Build with runtime packages under the Project Options, but when I checked I dont have that option.
Does anyone know how to solve this?
The error message indicates that either:
the compiler can't find the source file it needs for the unit.
the compiler found a .dcu file compiled with a different version of the compiler and needs to recompile it.
.dcu files are not compatible across compiler versions (with the single exception of D2006->D2007), meaning that every new version release of the compiler means all your source needs to be recompiled in order to be compatible with it.
You need to add the path to the source to Project->Options->Directories and Conditionals->Search Path so it can find the source code it needs.

How to add library paths in Delphi 10

I am trying to install GLscene but getting problems with the source file locations.
It says in the install instructions to add the GLscene source directories into the global library path in tool/options/Delphi options/Library, which I have done but it has no effect.
I can add the source directories into each package project directory and it then compiles, but I would rather have it accessible globally.
The GLscene library items I have entered are,
C:\Users\Andy\Documents\Embarcadero\Studio\Projects\GLScene_VCL\Source
C:\Users\Andy\Documents\Embarcadero\Studio\Projects\GLScene_VCL\Source\Shaders
C:\Users\Andy\Documents\Embarcadero\Studio\Projects\GLScene_VCL\Source\DesignTime
Which are all correct,
anybody know any reason why the compiler can't find the files in these directories?
The compiler will search for source files on the library path. Note that there are separate library paths for different targets, e.g. Win32, Win64 etc.
If you have source files that cannot be found, then they are not in the library path that you specified.
Personally I don't like the approach of using search paths for source files. I like everything under my project directory so that I can check out from my VCS and have everything I need to build right there. A search path based approach makes serious development very difficult because you cannot maintain branches. What if you have old versions to maintain that use old versions of your libraries?
Well this is a bit late but it could help someone else.
Try and add the paths to both the Library Path and the Debug DCU Path.
Recent Delphi versions have different build configurations for Release and Debug and my guess is that the Debug configuration only searches in the Debug DCU Path.

Xcode static libraries: Where are the symbols?

We have a rather large (and old) project, and we need to debug into a C++ function in a library that has not been touched for ages (64 Bit requirements you ask? How did you guess!)
But all we get is assembly code at that point.
It is further complicated by the fact that the library in question is build by some ancient CMake wizzardry.
My current main question is: if dsymutil --symtab does not list anything, does that mean there is no debug information in the .a file?
Or is there another, foolproof way to find out if DWARF debugging information has actually been generated?
I am asking, because on a sample project for a static lib I created, I see a symtab in the .o files, but not in the resulting .a file.
It turns out that dsymutil does not work well (or at all) with static libraries.
Using ar -x to extract the .o files and then using dsymutil on them appears to work, and thus solve my issue

Importing .dylib or .la files into iOS project

After reading this awesome post by Tristan, where he compiled FreeTDS for use in iOS, I attempted to compile UnixODBC for use in iOS. I was able to get it to compile, which is great.
However, when I compiled FreeTDS, I had a .a file that I was able to easily bring into XCode (along with a few .h files). This time, the compiler didn't produce a .a file. Instead, it produced a .la and a .dylib file. So far, I have not been able to use these files in my iOS project.
If I could accomplish any of the following, I think my problems would be solved:
1. Re-compile UnixODBC so that it produces a .a file, or
2. Convert either the .la or .dylib to a .a file, or
3. Import either the .la or .dylib to my project, so I can use it in the same way I would use a .a file.
So far, I am clueless as to how I would do any of these things (or if it's even possible). Can anybody please help me out?
Thank you!
-Rob
.dylib files are dynamically linked libraries, whereas .a files are statically linked ones (just google these two expressions). .la files are irrelevant now, they're not essential, and they don't contain any code,
If the configure script of UnixODBC supports it, you can specify the --enable-static --disable-shared options to enable building an .a archive and not a dylib. If the configure script doesn't accept these flags, then you can just go ahead a compile the source files (it will be done by configure), then instead of taking the resulting dylib, use the ar command to put the .o object files together to form a static archive.

Perform separate compilation of Latex documents

When compiling latex documents the compiler emits a lot of "object" files. This clutters the directories I'm working on and it difficults the use of VCS like SVN. When I work with C++ code I have separate directories for the code and the objects, I can run make on the source directory but the .o files go to the build directory.
Is there a proper way to perform this separate compilation with Latex documents? Can it be done by using Makefiles or by passing options to the latex compiler?
Thanks
You can use:
pdflatex --output-directory=tmp file.tex
and all the files will be stored in the folder tmp (pdf included).
Because this is not an optimal solution, I made my own tool, pydflatex, that compiles the LaTeX source by stashing away the auxilliary files (using the trick above), and brings the pdf back to the current directory, so after compiling you only have file.tex and file.pdf in your directory. This plays very well with version control.
I can't help much with LaTeX (having last user it seriously 20 years ago;-), but for Subversion, you should read up on the svn:ignore property -- it makes it easy to ignore files with extensions you do not want to version (object files, bytecode files as Python can often put in the same directory as the sources, backup files some text editors use, &c).
Latex generates the temporary files in the directory where the main document is located. If you want the contents to be placed in a different location, try with a main file like below.
\documentclass{article}
\input{src/maindocument.tex}
Using this method, you could maintain a directory structure like below
/
main.tex
/src
maindocument.tex
Two options, besides the above.
Use Lyx: it looks after the separate files. I think it copies the Latex file over to its own private directory and runs latex on it. In any case, nothing is created in the current directory.
Use a makefile or one of the special Latex make programs, and have your regular targets run make clean.

Resources