Skip to content

Commit 36b437e

Browse files
authored
Additional gcc16 changes for Alveo compilation (#9738) (#9739)
(cherry picked from commit 59ec704) Signed-off-by: Soren Soe <2106410+stsoe@users.noreply.github.com>
1 parent 2026f5d commit 36b437e

4 files changed

Lines changed: 11 additions & 60 deletions

File tree

src/runtime_src/core/pcie/emulation/hw_emu/alveo_shim/shim.cxx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// Copyright (C) 2016-2022 Xilinx, Inc. All rights reserved.
3-
// Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.
3+
// Copyright (C) 2022-2026 Advanced Micro Devices, Inc. All rights reserved.
44
#include "shim.h"
55
#include "system_hwemu.h"
66
#include "plugin/xdp/device_offload.h"
@@ -1749,7 +1749,6 @@ namespace xclhwemhal2 {
17491749
// Is there a way we can determine the name from the directories or otherwise?
17501750
std::string bdName("dr"); // Used to be opencldesign. This is new default.
17511751

1752-
int i = 0;
17531752
for(auto it :mBinaryDirectories)
17541753
{
17551754
std::string binaryDirectory = it.first;
@@ -1805,7 +1804,6 @@ namespace xclhwemhal2 {
18051804
std::string destPath8 = "'" + std::string(path) + "/" + fileName + "_xsc_report.log'";
18061805
systemUtil::makeSystemCall(xscReportLogFilePath, systemUtil::systemOperation::COPY, destPath8, std::to_string(__LINE__));
18071806
}
1808-
i++;
18091807
}
18101808
mBinaryDirectories.clear();
18111809
PRINTENDFUNC;

src/runtime_src/core/pcie/tools/xbflash.qspi/xspi.cpp

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
1-
/**
2-
* Copyright (C) 2020 Xilinx, Inc
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License"). You may
5-
* not use this file except in compliance with the License. A copy of the
6-
* License is located at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13-
* License for the specific language governing permissions and limitations
14-
* under the License.
15-
*/
1+
// SPDX-License-Identifier: Apache-2.0
2+
// Copyright (C) 2020 Xilinx, Inc
3+
// Copyright (C) 2026 Advanced Micro Devices, Inc. All rights reserved.
164

175
#include <iostream>
186
#include <string>
@@ -647,9 +635,7 @@ int XSPI_Flasher::parseMCS(std::istream& mcsStream) {
647635
ELARecord record;
648636
bool endRecordFound = false;
649637

650-
int lineno = 0;
651638
while (!mcsStream.eof() && !endRecordFound) {
652-
lineno++;
653639
std::string line;
654640
std::getline(mcsStream, line);
655641
if (line.size() == 0) {
@@ -1145,7 +1131,6 @@ bool XSPI_Flasher::finalTransfer(uint8_t *SendBufPtr, uint8_t *RecvBufPtr, int B
11451131
uint8_t* RecvBufferPtr = RecvBufPtr;
11461132

11471133
int RemainingBytes = ByteCount;
1148-
unsigned int BytesTransferred = 0;
11491134

11501135
/*
11511136
* Fill the DTR/FIFO with as many bytes as it will take (or as many as
@@ -1280,7 +1265,6 @@ bool XSPI_Flasher::finalTransfer(uint8_t *SendBufPtr, uint8_t *RecvBufPtr, int B
12801265
}
12811266
}
12821267

1283-
BytesTransferred += (DataWidth >> 3);
12841268
ByteCount -= (DataWidth >> 3);
12851269
StatusReg = XSpi_GetStatusReg();
12861270
if((StatusReg & (1<<10)) != 0) {

src/runtime_src/core/tools/xbmgmt2/flash/xmc.cpp

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
1-
/**
2-
* Copyright (C) 2019-2022 Xilinx, Inc
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License"). You may
5-
* not use this file except in compliance with the License. A copy of the
6-
* License is located at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13-
* License for the specific language governing permissions and limitations
14-
* under the License.
15-
*/
16-
1+
// SPDX-License-Identifier: Apache-2.0
2+
// Copyright (C) 2019-2022 Xilinx, Inc. All rights reserved.
3+
// Copyright (C) 2026 Advanced Micro Devices, Inc. All rights reserved.
174
#include <iostream>
185
#include <algorithm>
196
#include <cstring>
@@ -177,7 +164,6 @@ int XMC_Flasher::xclUpgradeFirmware(std::istream& tiTxtStream) {
177164
}
178165
default:
179166
{
180-
int spaces = 0;
181167
int digits = 0;
182168
std::locale loc;
183169

@@ -187,7 +173,7 @@ int XMC_Flasher::xclUpgradeFirmware(std::istream& tiTxtStream) {
187173

188174
for (unsigned int i = 0; i < line.size() && !errorFound; i++) {
189175
if (line[i] == ' ') {
190-
spaces++;
176+
//spaces++;
191177
} else if (std::isxdigit(line[i], loc)) {
192178
digits++;
193179
} else {

src/runtime_src/core/tools/xbmgmt2/flash/xspi.cpp

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
1-
/**
2-
* Copyright (C) 2019 - 2022 Xilinx, Inc
3-
* Copyright (C) 2022 Advanced Micro Devices, Inc.
4-
*
5-
* Licensed under the Apache License, Version 2.0 (the "License"). You may
6-
* not use this file except in compliance with the License. A copy of the
7-
* License is located at
8-
*
9-
* http://www.apache.org/licenses/LICENSE-2.0
10-
*
11-
* Unless required by applicable law or agreed to in writing, software
12-
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14-
* License for the specific language governing permissions and limitations
15-
* under the License.
16-
*/
1+
// SPDX-License-Identifier: Apache-2.0
2+
// Copyright (C) 2019-2022 Xilinx, Inc. All rights reserved.
3+
// Copyright (C) 2022-2026 Advanced Micro Devices, Inc. All rights reserved.
174
#include "xspi.h"
185
#include "core/common/system.h"
196
#include "core/common/device.h"
@@ -669,9 +656,7 @@ int XSPI_Flasher::parseMCS(std::istream& mcsStream) {
669656
ELARecord record;
670657
bool endRecordFound = false;
671658

672-
int lineno = 0;
673659
while (!mcsStream.eof() && !endRecordFound) {
674-
lineno++;
675660
std::string line;
676661
std::getline(mcsStream, line);
677662
if (line.size() == 0) {
@@ -1153,7 +1138,6 @@ bool XSPI_Flasher::finalTransfer(uint8_t *SendBufPtr, uint8_t *RecvBufPtr, int B
11531138
uint8_t* RecvBufferPtr = RecvBufPtr;
11541139

11551140
int RemainingBytes = ByteCount;
1156-
unsigned int BytesTransferred = 0;
11571141

11581142
/*
11591143
* Fill the DTR/FIFO with as many bytes as it will take (or as many as
@@ -1288,7 +1272,6 @@ bool XSPI_Flasher::finalTransfer(uint8_t *SendBufPtr, uint8_t *RecvBufPtr, int B
12881272
}
12891273
}
12901274

1291-
BytesTransferred += (DataWidth >> 3);
12921275
ByteCount -= (DataWidth >> 3);
12931276
StatusReg = XSpi_GetStatusReg();
12941277
if((StatusReg & (1<<10)) != 0) {

0 commit comments

Comments
 (0)