CXX on X86 : %ILINK-W-NORELO, RELA$K_R_X86_64_DTPOFF32 relocation not supported

Post Reply

Topic author
joukj
Master
Posts: 178
Joined: Thu Aug 27, 2020 5:50 am
Reputation: 0
Status: Offline

CXX on X86 : %ILINK-W-NORELO, RELA$K_R_X86_64_DTPOFF32 relocation not supported

Post by joukj » Tue Jul 18, 2023 5:46 am

Hi All,

When linking a C++ program on X86 (OpenVMS v9.2-1), I get the following warnings. What is hapening here. The source files lok simple ( see at the end of the message)

Code: Select all

%ILINK-W-NORELO, RELA$K_R_X86_64_TLSLD relocation not supported
	relocation section: .rela.text (section header entry: 3)
	relocation type: RELA$K_R_X86_64_TLSLD
	relocation entry: 4
	module: GRANDOM 
	file: $DSTM:[JOUKJ.public.poppler.poppler_2023-07-17.poppler.poppler]lib
poppler.olb;5 
%ILINK-W-NORELO, RELA$K_R_X86_64_DTPOFF32 relocation not supported
	relocation section: .rela.text (section header entry: 3)
	relocation type: RELA$K_R_X86_64_DTPOFF32
	relocation entry: 6
	module: GRANDOM 
	file: $DSTM:[JOUKJ.public.poppler.poppler_2023-07-17.poppler.poppler]lib
poppler.olb;5 
%ILINK-W-NORELO, RELA$K_R_X86_64_TLSLD relocation not supported
	relocation section: .rela.text (section header entry: 3)
	relocation type: RELA$K_R_X86_64_TLSLD
	relocation entry: 11
	module: GRANDOM 
	file: $DSTM:[JOUKJ.public.poppler.poppler_2023-07-17.poppler.poppler]lib
poppler.olb;5 
%ILINK-W-NORELO, RELA$K_R_X86_64_DTPOFF32 relocation not supported
	relocation section: .rela.text (section header entry: 3)
	relocation type: RELA$K_R_X86_64_DTPOFF32
	relocation entry: 13
	module: GRANDOM 
	file: $DSTM:[JOUKJ.public.poppler.poppler_2023-07-17.poppler.poppler]lib
poppler.olb;5 
%ILINK-W-NORELO, RELA$K_R_X86_64_TLSLD relocation not supported
	relocation section: .rela.text (section header entry: 3)
	relocation type: RELA$K_R_X86_64_TLSLD
	relocation entry: 17
	module: GRANDOM 
	file: $DSTM:[JOUKJ.public.poppler.poppler_2023-07-17.poppler.poppler]lib
poppler.olb;5 
%ILINK-W-NORELO, RELA$K_R_X86_64_DTPOFF32 relocation not supported
	relocation section: .rela.text (section header entry: 3)
	relocation type: RELA$K_R_X86_64_DTPOFF32
	relocation entry: 19
	module: GRANDOM 
	file: $DSTM:[JOUKJ.public.poppler.poppler_2023-07-17.poppler.poppler]lib
poppler.olb;5 
%ILINK-W-NORELO, RELA$K_R_X86_64_TLSLD relocation not supported
	relocation section: .rela.text (section header entry: 3)
	relocation type: RELA$K_R_X86_64_TLSLD
	relocation entry: 20
	module: GRANDOM 
	file: $DSTM:[JOUKJ.public.poppler.poppler_2023-07-17.poppler.poppler]lib
poppler.olb;5 
%ILINK-W-NORELO, RELA$K_R_X86_64_DTPOFF32 relocation not supported
	relocation section: .rela.text (section header entry: 3)
	relocation type: RELA$K_R_X86_64_DTPOFF32
	relocation entry: 22
	module: GRANDOM 
	file: $DSTM:[JOUKJ.public.poppler.poppler_2023-07-17.poppler.poppler]lib
poppler.olb;5 


rumba-jj) ty grandom.h
/*
 * grandom.h
 *
 * This file is licensed under the GPLv2 or later
 *
 * Pseudo-random number generation
 *
 * Copyright (C) 2012 Fabio D'Urso <fabiodurso@hotmail.it>
 * Copyright (C) 2018 Adam Reichold <adam.reichold@t-online.de>
 */

#ifndef GRANDOM_H
#define GRANDOM_H

/// Fills the given buffer with random bytes
void grandom_fill(unsigned char *buff, int size);

/// Returns a random number in [0,1)
double grandom_double();

#endif


rumba-jj) ty grandom.cc
/*
 * grandom.cc
 *
 * This file is licensed under the GPLv2 or later
 *
 * Pseudo-random number generation
 *
 * Copyright (C) 2012 Fabio D'Urso <fabiodurso@hotmail.it>
 * Copyright (C) 2018 Adam Reichold <adam.reichold@t-online.de>
 * Copyright (C) 2022 Albert Astals Cid <aacid@kde.org>
 */

#include "grandom.h"

#include <random>

namespace {

auto &grandom_engine()
{
    static thread_local std::default_random_engine engine { std::random_device {
}() };
    return engine;
}

}

void grandom_fill(unsigned char *buff, int size)
{
    auto &engine = grandom_engine();
    std::uniform_int_distribution<unsigned short> distribution { std::numeric_li
mits<unsigned char>::min(), std::numeric_limits<unsigned char>::max() };
    for (int index = 0; index < size; ++index) {
        buff[index] = static_cast<unsigned char>(distribution(engine));
    }
}

double grandom_double()
{
    auto &engine = grandom_engine();
    return std::generate_canonical<double, std::numeric_limits<double>::digits>(
engine);
}

regards
' Jouk


hb
Valued Contributor
Posts: 80
Joined: Mon May 01, 2023 12:11 pm
Reputation: 0
Status: Offline

Re: CXX on X86 : %ILINK-W-NORELO, RELA$K_R_X86_64_DTPOFF32 relocation not supported

Post by hb » Tue Jul 18, 2023 8:48 am

A compiler for VMS should not generate these relocations.

R_X86_64_TLSLD and R_X86_64_DTPOFF32 are thread-local relocations. They are used in an x86-64 thread model, which is not supported on VMS.


jreagan
VSI Expert
Master
Posts: 141
Joined: Tue Dec 01, 2020 8:40 am
Reputation: 0
Status: Offline

Re: CXX on X86 : %ILINK-W-NORELO, RELA$K_R_X86_64_DTPOFF32 relocation not supported

Post by jreagan » Tue Jul 18, 2023 11:13 am

We should get the compiler to issue an error message about those "thread_local" type modifiers for now. Future plans for TLS support are undecided at the moment.


Topic author
joukj
Master
Posts: 178
Joined: Thu Aug 27, 2020 5:50 am
Reputation: 0
Status: Offline

Re: CXX on X86 : %ILINK-W-NORELO, RELA$K_R_X86_64_DTPOFF32 relocation not supported

Post by joukj » Wed Jul 19, 2023 5:37 am

But for now: is this a warning I can ignore?


jreagan
VSI Expert
Master
Posts: 141
Joined: Tue Dec 01, 2020 8:40 am
Reputation: 0
Status: Offline

Re: CXX on X86 : %ILINK-W-NORELO, RELA$K_R_X86_64_DTPOFF32 relocation not supported

Post by jreagan » Wed Jul 19, 2023 9:23 am

No, you cannot just ignore it. The compiler generated code assuming that the linker/image-activator/system knows how to allocate thread-specific stack space. That support is not there. You can use pthreads calls to roll-your-own thread-local storage, but I'm not sure how to map ALL the C++ thread_local (yes, thread_local was in C++11) usage into pthreads equivalents. The ignorned relocation will result in a 0 somewhere in the generated code and you'll probably get an ACCVIO.

We have some missing pieces in the language RTLs (many of the C++17 STL classes, this TLS support (both for C++ and C11-mode in clang, etc).

Post Reply