Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error on master, on Ubuntu 24.04 vanilla #449

Open
tlacroix opened this issue Jan 17, 2025 · 4 comments
Open

Build error on master, on Ubuntu 24.04 vanilla #449

tlacroix opened this issue Jan 17, 2025 · 4 comments

Comments

@tlacroix
Copy link

tlacroix commented Jan 17, 2025

We regularly build the master branch on vanilla Ubuntu 24.04 on EC2 x64 instances (tonight, ami-04b4f1a9cf54c11d0/amazon/ubuntu/images/hvm-ssd-gp3/ubuntu-noble-24.04-amd64-server-20250115 in us-east-1)

The last time we successfully did (before it failed tonight) was on 2024-12-18 18:42:26 UTC-0500.

So our problem must be related to one or many of the 7 commits of 3 Jan 2025.

You'll find the last few lines of our compile log below. Please let me know if you need more info.

--

We version pinned on 4.1.1 to work around this, so it's not impairing us.

It's really just a heads up. You may close this issue anytime, we just wanted to make you aware of this issue.

--

[stderr] 1048I bits [codesize[i]]++;
[stderr] I ~~~~~~
~NAN
[stderr]/root/mozjpeg/jchuff.c:951:9: note: at offset 33 into destination object 'bits'
bitsiki = # of sumbols with code Lenath k *
of size 33
[stderr] 951 | UINT8 bits [MAX_CLEN + 1]; /* bits[k] = # of symbols with code length k */
[stderr] I ANN
[stdout][ 87%] Linking C shared library libturbojpeg.so
[stderr]/usr/bin/ld: simd/MakeFiles/simd.dir/x86_64/jsimd.c.o: relocation R_X86_64_TPOFF32 against 'simd_support' can not be used when making a shared object;
recompile with -fPIC
[stderr]/usr/bin/ld: failed to set dynamic section sizes: bad value [stderr]collect2: error: ld returned 1 exit status
[stderr]make[2]: *** [MakeFiles/turbojpeg.dir/build.make:1255: libturbojpeg.so.0.3.01
Error 1
[stderr]make[1]: *** [MakeFiles/Makefile2:295: MakeFiles/turbojpeg.dir/all] Error 2
[stderr]make[1]: *** Waiting for unfinished jobs....
[stderr]/root/mozjpeg/jchuff.c: In function 'jpeg_gen_optimal_table' :
[stderr]/root/mozjpeg/jchuff. c: 1048:22: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
[stderr] 1048 | bits[codesize[i]]++;
[stderr]/root/mozjpeg/jchuff.c:951:9: note: at offset 33 into destination object 'bits'
of size 33
[stderr] 951 | UINT8 bits[MAX_CLEN + 1]; /* bits[k] = # of symbols with code length k */
[stderr] | Arr
[stdout][ 87%] Linking C shared library ../libjpeg. so
[stderr]/usr/bin/ld: /simd/CMakeFiles/simd.dir/x86_64/jsimd.c.o: relocation R_X86_64_TPOFF32 against 'simd_support' can not be used when making a shared object; recompile with -fPIC
[stderr]/us/bin/ld: failed to set dynamic section sizes: bad value [stderr]collect2: error: ld returned 1 exit status
[stderr]make[2]: *** [sharedlib/MakeFiles/jpeg.dir/build.make:1119: libjpeg.so.62.4.0 Error 1 [stderr]make[1]: *** [MakeFiles/Makefile2:843: sharedlib/(MakeFiles/jpeg.dir/all]
Error 2
[stderr]make: *** [Makefile:146: all] Error 2
@tlacroix tlacroix changed the title Build error on master, on Ubuntu 24.04 Pro Build error on master, on Ubuntu 24.04 vanilla Jan 17, 2025
@tlacroix
Copy link
Author

tlacroix commented Jan 17, 2025

Addendum:

Our compile script is as simple as it gets, on a vanilla EC2 Ubuntu 24.04 x64 instance:

git clone https://github.com/mozilla/mozjpeg.git
cd mozjpeg || exit
cmake -G"Unix Makefiles"
make
make install

@erictroebs
Copy link

I have created a Dockerfile to reproduce the issue with different Ubuntu versions and different commits.

My findings:

  • Neither 24.04 nor 22.04 works.
  • Last commit that works 15274b9 from 2024-12-23
  • First commit that does not work is c6d33b6 from 2024-12-23

The latter mentioned has changed a lot in CMakeLists.txt without updating BUILDING.md.

@erictroebs
Copy link

I am able to compile the most recent commit 9b8d11f by adding -fPIC to the compiler flags:

export CFLAGS='-fPIC'
cmake -G"Unix Makefiles"
make

Older commits may still fail because of an unlinked math function. Without testing I guess this was fixed in b6e0d50.

Disclaimer: I am not experienced enough in C to fully understand all implications introduced by adding -fPIC. Therefore, I will not create a pull request on this.

@tlacroix
Copy link
Author

tlacroix commented Jan 17, 2025

@erictroebs Thanks for the extra info.

Not an experienced C/C++ programmer either, but in a nutshell, the -fPIC flag changes how the compiler computes its references.

While I don't think this compiler flag should be necessary to build the code since it's not included in the build scripts, it might be a useful clue for the developers to pin-point the source of the problem.

Thanks for all the details about how you were able to reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants