These paths are hard-wired into GCC and it works from there. GCC says the answer here is "the hard way" because it builds everything piece by piece, and does not use shared libraries. Build the infrastructure in a temp directory that is different than the downloads directory or its subdirectories:. The --disable-shared flag may be worth a closer look depending on your needs. I use --disable-shared because I am building static code only, and I want to make sure that I don't build any shared code.
My need is to move the resulting GCC around my drives easily, so I want all static code, and I do not want any shared code. If you prefer shared code, omit the --disable-shared flag. When you run any of the commands in this answer, be sure to update the commands to use the current GCC version number that matches your needs. The commands in this answer are for GCC 4. Note that the GCC documentation says: "While any sufficiently new version of required tools usually work, library requirements are generally stricter.
Newer versions may work in some cases, but it's safer to use the exact versions documented. This library provides architecture-independent size and endian support. Build gcc in a scratch directory on the same mount point. The configure command and its flags must be all on one command line this post shows them on separate lines just because of web page width. More generally, optimizations are symbolic processing, and symbolic processing usually needs bignums.
During such optimizations, quite big numbers could appear even if the source code has only quite small constants. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams?
Collectives on Stack Overflow. Learn more. Why does gcc require gmp? Ask Question. Asked 8 years, 7 months ago. Active 8 years, 7 months ago. Viewed times. Improve this question. Brian Bi Brian Bi I will assume access to a linux machine with GMP installed. GMP can be downloaded from the gmplib. Computers process numbers 32 or 64 bits at a time. If you write a program in C and declare int x , the int is a 32 bit number or sometimes 64 bits.
It all depends on your machine and your compiler. Notice that the computer can represent numbers in the range to Any attempt to add one to the maximum int wraps around to the minimum integer. This is fine for most applications that need some addition. For instance, a bank has to worry if someone has 2 billion or more dollars in their account that if they deposit a single dollar, their balance will wrap around. C also has a type long that supports 64 bit arithmetic.
In fact, intel processors manufactured today have 64 bit word sizes. Preprocessing is done separately in some configure tests. Some build-time programs are compiled and run to generate host-specific data tables. A separate libgmpxx. Future changes to the relevant internals will be accompanied by renaming, so a mismatch will cause unresolved symbols rather than perhaps mysterious misbehaviour. In general libgmpxx. Perhaps this will change in the future.
Although gcc for instance recognises foo. For convenience, the following choices are also available. It actually allocates just small blocks on the stack; larger ones use malloc-reentrant. See Custom Allocation. The FFT is only used on large to very large operands and can be disabled to save code size if desired.
0コメント