From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-xb31.google.com (mail-yb1-xb31.google.com [IPv6:2607:f8b0:4864:20::b31]) by sourceware.org (Postfix) with ESMTPS id 83A7F385842C for ; Tue, 20 Dec 2022 16:07:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 83A7F385842C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-yb1-xb31.google.com with SMTP id c124so9193488ybb.13 for ; Tue, 20 Dec 2022 08:07:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=4pTOMnVspi1inOhPZzOkSr+byB0/ev/Nj9DzoSjX10Y=; b=pOG6ln0MM1KbY5rLcFfq507I62V50Uxm2I8Jn+V4ekU5JJLzQgPtQYrRRwA6RRKdiB SnfPQs5A+m4Dq1P7luUipTGg89jvRNZXrbo/W2gYwYU/JBwjhtPoOgNdG0SeibS7ISzb 5ECXlgwn/WWSC7xUymr9rR4QApGNVoHBcXKAspqAeZc0YgIMy6uSJXnoqQmEryEyXOQp zj7LWcCXhlk4z4pfvBL2sksD9xUB/qM7anA9U62extmJ+oM0+EctEuWuHrNlF51QDUES tSET6EZCraN/m5VPV4K0JAbdaUUkspmQ/MYsTnhuoA4bTU1fSM1U7yGZIUkfFjw4w/4o JO2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=4pTOMnVspi1inOhPZzOkSr+byB0/ev/Nj9DzoSjX10Y=; b=zcepwe/zZXFBcOU3BmFEBDiY9FvWmtEmDk1ZMW4+PPYHA8iq4D1JuW/G8G+MGjZLh6 e7ghH5ISjYM39GVaXDH9LAZGZktX2zycJ+MI03wvJ7YHSS1eqZpwCxYYUHFm8QL9u8wN 6tI98KN/xMT0EYuz+iPwgWafdfQcMWFdYR4wMZADNmYq6sfLePQV4cLqohGmgQ255Ldx NWq2DUQYP0Cy11bch0In2j+TUhdMxHfTDY8t+yhOjZzOZEoGQ741lQO7FmKYNeilwI3A DPEvhdbUkkfR7DNBIbi41Vz2pjc1/Q8nm/45rS796wgQjZsgykejFuoqnA+VZ8PGXq0l +bxQ== X-Gm-Message-State: AFqh2kpe9ek4Eh5hfhL/E3eQtxnQq2TuEV4fm2dcTbWzZ70LJfGS1rQL 3zj3YZkoOQANSlEdrYmN0w7BpHdHPoa0PyBIDzqhQ5DFnltraQ== X-Google-Smtp-Source: AMrXdXt9eEH/k/P5KkHC79fg4g5GoRGrzEEedzGECkE9kmqVJzqVDnT0mjpQXPWmZgm4fnCLPhgsKhjdhay0EYZoE8I= X-Received: by 2002:a25:d2c8:0:b0:757:bf6:9bef with SMTP id j191-20020a25d2c8000000b007570bf69befmr6912ybg.427.1671552422429; Tue, 20 Dec 2022 08:07:02 -0800 (PST) MIME-Version: 1.0 From: SuHsueyu Date: Wed, 21 Dec 2022 00:06:50 +0800 Message-ID: Subject: Need Help: gcc suppport for bpf target To: gcc-help@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hello, I'm new to gcc bpf. Currently, I use gcc 12.1.0, and I compiled a ebpf map definition source file t.c: struct t { int a:2; int b:3; int c:2; } g; with gcc -c -gbtf t.c and use readelf to read the obj file. But the machine section is x86-64, my machine architure, and I expected "Machine: Linux BPF" which can be compiled with clang -target bpf t.c. I'm curious if GCC allows for the generation of target BPF. Or if there's a useful compile option I'm missing.