Hi Francois,
jsut trying to understand the problem a bit more.
Does the problem happens only in Fedora 38? In Fedora 37 you don't see this?
Is there any difference in the configuration for the two versions?
Does the problem happens if you try building with ninja instead of make?
How about if you use clang instead of gcc?
This seems to be a tricky one to debug, but obviously we need to find a solution for it.
Hi Francois,
jsut trying to understand the problem a bit more.
Does the problem happens only in Fedora 38? In Fedora 37 you don't see this?
Is there any difference in the configuration for the two versions?
Does the problem happens if you try building with ninja instead of make?
How about if you use clang instead of gcc?
This seems to be a tricky one to debug, but obviously we need to find a solution for it.
The problem only occurs on Fedora 38, no problem on Fedora 37.
I'm using the same build environment for both distributions. The only potential difference are the cflags/cxxflags: I'm using the distribution defaults build flags, which may differ accross distributions.
I don't manage to build tqt3 using ninja, it looks like script './configure' is hardcoded to use make/gmake.
It looks like GNU ld does not like clang compiled code.
Hello Michele,
The problem only occurs on Fedora 38, no problem on Fedora 37.
I'm using the same build environment for both distributions. The only potential difference are the cflags/cxxflags: I'm using the distribution defaults build flags, which may differ accross distributions.
I don't manage to build tqt3 using ninja, it looks like script './configure' is hardcoded to use make/gmake.
Trying to build with clang, I'm getting error :
```
clang++ -o tqmake project.o property.o main.o makefile.o unixmake2.o unixmake.o msvc_nmake.o borland_bmake.o mingw_make.o msvc_dsp.o msvc_vcproj.o option.o winmakefile.o projectgenerator.o metrowerks_xml.o pbuilder_pbx.o msvc_objectmodel.o meta.o qtmd5.o qstring.o qtextstream.o qiodevice.o qglobal.o qgdict.o qcstring.o qdatastream.o qgarray.o qbuffer.o qglist.o qptrcollection.o qfile.o qfile_unix.o qregexp.o qgvector.o qgcache.o qbitarray.o qdir.o quuid.o qfileinfo_unix.o qdir_unix.o qfileinfo.o qdatetime.o qstringlist.o qmap.o qconfig.o qunicodetables.o qsettings.o qlocale.o -luuid
project.o: file not recognized: file format not recognized
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[1]: *** [Makefile:54: tqmake] Error 1
gmake[1]: Leaving directory '/tmp/BUILD.fc38.x86_64/trinity-tqt3-14.1.0/qmake'
qmake failed to build. Aborting.
```
It looks like GNU ld does not like clang compiled code.
Hi Francois,
I guess it may be worth checking if there is any difference in cflags/cxxflags between v37 and v38, although it sounds a bit weird if the problem comes from there. I think the problem is more likely to come from different gcc versions, with the one in v38 probably doing some different things.
If you could upload the required docker file for fedora 38 on tde-packaging, I will try replicating the issue here during the coming week, following your instruction from here.
Hi Francois,
I guess it may be worth checking if there is any difference in cflags/cxxflags between v37 and v38, although it sounds a bit weird if the problem comes from there. I think the problem is more likely to come from different gcc versions, with the one in v38 probably doing some different things.
If you could upload the required docker file for fedora 38 on tde-packaging, I will try replicating the issue here during the coming week, following your instruction from [here](https://mirror.git.trinitydesktop.org/gitea/TDE/bibletime/issues/6#issuecomment-24667).
@Francois
Btw, since this may take a while to get fixed and since R14.1.0 has officially been released, would you mind uploading the packages for the distros for which RPM already exists so that users can update?
@Francois
Btw, since this may take a while to get fixed and since R14.1.0 has officially been released, would you mind uploading the packages for the distros for which RPM already exists so that users can update?
Yes, I'm currently signing and preparing packages for other distributions :)
I've just commit/push the docker files for fedora38 in r14.1.x branch.
I've tried using 'lld' linker instead of 'ld'. I get strange build results:
gcc + ld: FTBFS
gcc + lld: OK
clang + ld: FTBFS
clang + lld: FTBFS
Things are getting stranger ...
When insisting with 'make' command, it ends up building ...
After the FTBFS occurs, go to the failed directory, e.g. '/tmp/BUILD.fc38.x86_64/trinity-tqt3-14.1.0/qmake', then run 'make'.
After several attempts (about 5), it ends up compiling ...
Things are getting stranger ...
When insisting with 'make' command, it ends up building ...
After the FTBFS occurs, go to the failed directory, e.g. '/tmp/BUILD.fc38.x86_64/trinity-tqt3-14.1.0/qmake', then run 'make'.
After several attempts (about 5), it ends up compiling ...
Hi @Francois,
I managed to build the f38 container and take a look.
The problem comes from the new _FORTIFY_SOURCE=3 introduced in recent gcc. As a temporary workaround, if you force _FORTIFY_SOURCE=2 (as I suspect it is the default in f37) tqt3 builds fine.
This is obviously a workaround for the time being, we need to track down what is causing the buffer overflow with _FORTIFY_SOURCE=3 since it may become the standard in other distros too and therefore likely to affect future builds.
For a quick test, try this patch. It is probably not the correct way to set CFLAGS in fedora, but it shows that tqt3 builds.
Hi @Francois,
I managed to build the f38 container and take a look.
The problem comes from the new `_FORTIFY_SOURCE=3` introduced in recent gcc. As a temporary workaround, if you force `_FORTIFY_SOURCE=2` (as I suspect it is the default in f37) tqt3 builds fine.
This is obviously a workaround for the time being, we need to track down what is causing the buffer overflow with `_FORTIFY_SOURCE=3` since it may become the standard in other distros too and therefore likely to affect future builds.
For a quick test, try this patch. It is probably not the correct way to set CFLAGS in fedora, but it shows that tqt3 builds.
```
diff --git a/redhat/dependencies/tqt3/tqt3.spec b/redhat/dependencies/tqt3/tqt3.spec
index 4d79d2247..a1faff665 100644
--- a/redhat/dependencies/tqt3/tqt3.spec
+++ b/redhat/dependencies/tqt3/tqt3.spec
@@ -1270,7 +1270,7 @@ echo "sle_version = %{?sle_version}"
-e "s|^QMAKE_INCDIR_TQT.*|QMAKE_INCDIR_TQT = %{_includedir}/tqt3|" \
-e "s|\$(QTDIR)|/usr|g" \
-e "s|-lqt|-ltqt|g" \
- -e "s|^QMAKE_CFLAGS =.*|QMAKE_CFLAGS = %{?optflags} -pipe -fvisibility=hidden -fvisibility-inlines-hidden|" \
+ -e "s|^QMAKE_CFLAGS =.*|QMAKE_CFLAGS = %{?optflags} -pipe -fvisibility=hidden -fvisibility-inlines-hidden -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=2|" \
-e "s|^QMAKE_INCDIR =.*|QMAKE_INCDIR = %{_includedir}|" \
-e "s|^QMAKE_LIBDIR =.*|QMAKE_LIBDIR = %{_libdir}|" \
-e "s|^QMAKE_RPATH = .*|QMAKE_RPATH =|" \
```
It may also be worth that enabling _FORTIFY_SOURCE=3 in f37 leads to the same problem, since the feature is available from gcc12, which is shipped in f37.
It may also be worth that enabling `_FORTIFY_SOURCE=3` in f37 leads to the same problem, since the feature is available from gcc12, which is shipped in f37.
Hello @MicheleC , thanks for your support.
You are correct, Fedora 37 uses FORTIFY_SOURCE=2 by default, whereas Fedora 38 uses FORTIFY_SOURCE=3.
Other packages, like tdelibs, are also impacted.
For now, I will set FORTIFY_SOURCE=2 for Fedora 38 and (attempt to) build all packages.
Hello @MicheleC , thanks for your support.
You are correct, Fedora 37 uses FORTIFY_SOURCE=2 by default, whereas Fedora 38 uses FORTIFY_SOURCE=3.
Other packages, like tdelibs, are also impacted.
For now, I will set FORTIFY_SOURCE=2 for Fedora 38 and (attempt to) build all packages.
Not surprised at all and I expect Debian and other distros to display the same behavior when gcc12 or higher is available and _FORTIFY_SOURCE is set to 3. It will probably be a long fixing up effort that span the whole TDE.
> Other packages, like tdelibs, are also impacted.
Not surprised at all and I expect Debian and other distros to display the same behavior when gcc12 or higher is available and `_FORTIFY_SOURCE` is set to 3. It will probably be a long fixing up effort that span the whole TDE.
It may also be worth that enabling _FORTIFY_SOURCE=3 in f37 leads to the same problem, since the feature is available from gcc12, which is shipped in f37.
I tried forcing _FORTIFY_SOURCE=3 in Debian with gcc 12.2 and tqt3 failed with the same buffer overflow message. tdelibs though built fine.
> It may also be worth that enabling `_FORTIFY_SOURCE=3` in f37 leads to the same problem, since the feature is available from gcc12, which is shipped in f37.
I tried forcing `_FORTIFY_SOURCE=3` in Debian with gcc 12.2 and tqt3 failed with the same buffer overflow message. tdelibs though built fine.
Automatic build for Noble (all architectures) fails. When manual triggering build in Noble build-root, it is completed without any problems. Build log attached.
Automatic build for Noble (all architectures) fails. When manual triggering build in Noble build-root, it is completed without any problems. Build log attached.
After applying the tqt3 patch from #100, I've managed to rebuild all Fedora 39 packages using FORTIFYSOURCE=3.
So I believe this issue can be closed.
Hello, happy new year to all :)
After applying the tqt3 patch from https://mirror.git.trinitydesktop.org/gitea/TDE/tqt3/pulls/100, I've managed to rebuild all Fedora 39 packages using FORTIFYSOURCE=3.
So I believe this issue can be closed.
Basic information
Description
During TQT3 build, the compiler says "buffer overflow detected : terminated"
And the build is stopped.
Compiler information:
Steps to reproduce
Build
Screenshots
See attached file for detailed output.
Zipped log file because of size limitation.
Hi Francois,
jsut trying to understand the problem a bit more.
Does the problem happens only in Fedora 38? In Fedora 37 you don't see this?
Is there any difference in the configuration for the two versions?
Does the problem happens if you try building with ninja instead of make?
How about if you use clang instead of gcc?
This seems to be a tricky one to debug, but obviously we need to find a solution for it.
Hello Michele,
The problem only occurs on Fedora 38, no problem on Fedora 37.
I'm using the same build environment for both distributions. The only potential difference are the cflags/cxxflags: I'm using the distribution defaults build flags, which may differ accross distributions.
I don't manage to build tqt3 using ninja, it looks like script './configure' is hardcoded to use make/gmake.
Trying to build with clang, I'm getting error :
It looks like GNU ld does not like clang compiled code.
Hi Francois,
I guess it may be worth checking if there is any difference in cflags/cxxflags between v37 and v38, although it sounds a bit weird if the problem comes from there. I think the problem is more likely to come from different gcc versions, with the one in v38 probably doing some different things.
If you could upload the required docker file for fedora 38 on tde-packaging, I will try replicating the issue here during the coming week, following your instruction from here.
@Francois
Btw, since this may take a while to get fixed and since R14.1.0 has officially been released, would you mind uploading the packages for the distros for which RPM already exists so that users can update?
Yes, I'm currently signing and preparing packages for other distributions :)
I've just commit/push the docker files for fedora38 in r14.1.x branch.
I've tried using 'lld' linker instead of 'ld'. I get strange build results:
gcc + ld: FTBFS
gcc + lld: OK
clang + ld: FTBFS
clang + lld: FTBFS
Great, I will take a look during next week and let you know what I can find.
Things are getting stranger ...
When insisting with 'make' command, it ends up building ...
After the FTBFS occurs, go to the failed directory, e.g. '/tmp/BUILD.fc38.x86_64/trinity-tqt3-14.1.0/qmake', then run 'make'.
After several attempts (about 5), it ends up compiling ...
Hi @Francois,
I managed to build the f38 container and take a look.
The problem comes from the new
_FORTIFY_SOURCE=3
introduced in recent gcc. As a temporary workaround, if you force_FORTIFY_SOURCE=2
(as I suspect it is the default in f37) tqt3 builds fine.This is obviously a workaround for the time being, we need to track down what is causing the buffer overflow with
_FORTIFY_SOURCE=3
since it may become the standard in other distros too and therefore likely to affect future builds.For a quick test, try this patch. It is probably not the correct way to set CFLAGS in fedora, but it shows that tqt3 builds.
For further info/reading, see here:
https://developers.redhat.com/articles/2022/09/17/gccs-new-fortification-level
It may also be worth that enabling
_FORTIFY_SOURCE=3
in f37 leads to the same problem, since the feature is available from gcc12, which is shipped in f37.Hello @MicheleC , thanks for your support.
You are correct, Fedora 37 uses FORTIFY_SOURCE=2 by default, whereas Fedora 38 uses FORTIFY_SOURCE=3.
Other packages, like tdelibs, are also impacted.
For now, I will set FORTIFY_SOURCE=2 for Fedora 38 and (attempt to) build all packages.
Not surprised at all and I expect Debian and other distros to display the same behavior when gcc12 or higher is available and
_FORTIFY_SOURCE
is set to 3. It will probably be a long fixing up effort that span the whole TDE.I tried forcing
_FORTIFY_SOURCE=3
in Debian with gcc 12.2 and tqt3 failed with the same buffer overflow message. tdelibs though built fine.Automatic build for Noble (all architectures) fails. When manual triggering build in Noble build-root, it is completed without any problems. Build log attached.
Hello, happy new year to all :)
After applying the tqt3 patch from #100, I've managed to rebuild all Fedora 39 packages using FORTIFYSOURCE=3.
So I believe this issue can be closed.
Great, thanks for the feedback @Francois and happy new year to you too!